Add status destroy authorization to policy (#3453)
* Add status destroy authorization to policy * Create explicit unreblog status authorization
This commit is contained in:
parent
3576fa0d59
commit
33f669a5f8
6 changed files with 78 additions and 5 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
class ProcessInteractionService < BaseService
|
||||
include AuthorExtractor
|
||||
include Authorization
|
||||
|
||||
# Record locally the remote interaction with our user
|
||||
# @param [String] envelope Salmon envelope
|
||||
|
@ -46,7 +47,7 @@ class ProcessInteractionService < BaseService
|
|||
reflect_unblock!(account, target_account)
|
||||
end
|
||||
end
|
||||
rescue Goldfinger::Error, HTTP::Error, OStatus2::BadSalmonError
|
||||
rescue Goldfinger::Error, HTTP::Error, OStatus2::BadSalmonError, Mastodon::NotPermittedError
|
||||
nil
|
||||
end
|
||||
|
||||
|
@ -103,7 +104,9 @@ class ProcessInteractionService < BaseService
|
|||
|
||||
return if status.nil?
|
||||
|
||||
RemovalWorker.perform_async(status.id) if account.id == status.account_id
|
||||
authorize_with account, status, :destroy?
|
||||
|
||||
RemovalWorker.perform_async(status.id)
|
||||
end
|
||||
|
||||
def favourite!(xml, from_account)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue