mirror of https://github.com/tootsuite/mastodon
Simplify case for permission finder
parent
21ff5e9656
commit
bca7d9302b
|
@ -58,11 +58,11 @@ class Webhook < ApplicationRecord
|
||||||
|
|
||||||
def self.permission_for_event(event)
|
def self.permission_for_event(event)
|
||||||
case event
|
case event
|
||||||
when 'account.approved', 'account.created', 'account.updated'
|
when /account/
|
||||||
:manage_users
|
:manage_users
|
||||||
when 'report.created', 'report.updated'
|
when /report/
|
||||||
:manage_reports
|
:manage_reports
|
||||||
when 'status.created', 'status.updated'
|
when /status/
|
||||||
:view_devops
|
:view_devops
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue