Reassign permissions for new webhook events

This commit is contained in:
CSDUMMI 2024-01-15 19:22:08 +01:00
parent fd63bc10f4
commit f903a90785
1 changed files with 4 additions and 5 deletions

View File

@ -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