Fix moderator rights inconsistencies (#26729)
This commit is contained in:
parent
93d051e47d
commit
b83e487502
6 changed files with 47 additions and 9 deletions
|
@ -12,7 +12,7 @@ class Admin::StatusPolicy < ApplicationPolicy
|
|||
end
|
||||
|
||||
def show?
|
||||
role.can?(:manage_reports, :manage_users) && (record.public_visibility? || record.unlisted_visibility? || record.reported?)
|
||||
role.can?(:manage_reports, :manage_users) && (record.public_visibility? || record.unlisted_visibility? || record.reported? || viewable_through_normal_policy?)
|
||||
end
|
||||
|
||||
def destroy?
|
||||
|
@ -26,4 +26,10 @@ class Admin::StatusPolicy < ApplicationPolicy
|
|||
def review?
|
||||
role.can?(:manage_taxonomies)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def viewable_through_normal_policy?
|
||||
StatusPolicy.new(current_account, record, @preloaded_relations).show?
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue