Move status reblog authorization into policy (#3425)
This commit is contained in:
parent
bc4fad9e22
commit
e031fd60ad
3 changed files with 42 additions and 11 deletions
|
@ -11,8 +11,7 @@ class ReblogService < BaseService
|
|||
def call(account, reblogged_status)
|
||||
reblogged_status = reblogged_status.reblog if reblogged_status.reblog?
|
||||
|
||||
authorize_with account, reblogged_status, :show?
|
||||
raise Mastodon::NotPermittedError if reblogged_status.direct_visibility? || reblogged_status.private_visibility?
|
||||
authorize_with account, reblogged_status, :reblog?
|
||||
|
||||
reblog = account.statuses.create!(reblog: reblogged_status, text: '')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue