Add mutual visibility support
This commit is contained in:
parent
9662e6ae32
commit
79062bfc2f
14 changed files with 85 additions and 9 deletions
|
@ -62,7 +62,12 @@ class StatusesController < ApplicationController
|
|||
|
||||
def set_status
|
||||
@status = @account.statuses.find(params[:id])
|
||||
authorize @status, :show?
|
||||
|
||||
if request.authorization.present? && request.authorization.match(/^Bearer /i)
|
||||
raise Mastodon::NotPermittedError unless @status.capability_tokens.find_by(token: request.authorization.gsub(/^Bearer /i, ''))
|
||||
else
|
||||
authorize @status, :show?
|
||||
end
|
||||
rescue Mastodon::NotPermittedError
|
||||
not_found
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue