Use `distributable?` method in admin/status_policy method (#33477)

pull/33482/head
Matt Jankowski 5 days ago committed by GitHub
parent efcd4ea5de
commit dd937e115a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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? || viewable_through_normal_policy?)
role.can?(:manage_reports, :manage_users) && eligible_to_show?
end
def destroy?
@ -29,6 +29,10 @@ class Admin::StatusPolicy < ApplicationPolicy
private
def eligible_to_show?
record.distributable? || record.reported? || viewable_through_normal_policy?
end
def viewable_through_normal_policy?
StatusPolicy.new(current_account, record, @preloaded_relations).show?
end

Loading…
Cancel
Save