mirror of https://github.com/mastodon/mastodon
Reassign permissions for new webhook events
This commit is contained in:
parent
fd63bc10f4
commit
f903a90785
|
@ -24,11 +24,8 @@ class Webhook < ApplicationRecord
|
|||
status.created
|
||||
status.updated
|
||||
block.created
|
||||
block.removed
|
||||
follow.created
|
||||
follow.removed
|
||||
mute.created
|
||||
mute.removed
|
||||
).freeze
|
||||
|
||||
attr_writer :current_account
|
||||
|
@ -64,11 +61,13 @@ class Webhook < ApplicationRecord
|
|||
|
||||
def self.permission_for_event(event)
|
||||
case event
|
||||
when 'account.approved', 'account.created', 'account.updated'
|
||||
when 'account.approved', 'account.created', 'account.updated', 'follow.created'
|
||||
:manage_users
|
||||
when 'report.created', 'report.updated'
|
||||
:manage_reports
|
||||
when 'status.created', 'status.updated', 'block.created', 'block.removed', 'follow.created', 'follow.removed', 'mute.created', 'mute.removed' # TODO: find the correct permission
|
||||
when 'block.created', 'mute.created'
|
||||
:manage_blocks
|
||||
when 'status.created', 'status.updated'
|
||||
:view_devops
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue