mirror of
https://github.com/mastodon/mastodon.git
synced 2026-09-13 01:45:59 -05:00
17 lines
440 B
Ruby
17 lines
440 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Admin::PermissionsConcern
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
before_action :require_moderator_or_admin_permissions
|
|
end
|
|
|
|
private
|
|
|
|
def require_moderator_or_admin_permissions
|
|
# not using #authorize here, so #verify_authorized still makes sure more fine-grained rules are enforced down the line
|
|
forbidden unless Admin::BasePolicy.new(current_account, :base).access?
|
|
end
|
|
end
|