FIX: Hide a post's pending flag count from TL4 users. (#13129)

They can't see the review queue, so there's no reason to show a button with the post's pending flag count in the post controls.
This commit is contained in:
Roman Rizzi
2021-05-25 23:58:00 -03:00
committed by GitHub
parent a5273b37f7
commit a5fddd5cdb
2 changed files with 16 additions and 1 deletions

View File

@@ -17,9 +17,15 @@ module TopicGuardian
return false if anonymous? || topic.nil?
return true if is_staff?
is_category_group_moderator?(topic.category)
end
def can_moderate_topic?(topic)
return false if anonymous? || topic.nil?
return true if is_staff?
can_perform_action_available_to_group_moderators?(topic)
end
alias :can_moderate_topic? :can_review_topic?
def can_create_shared_draft?
SiteSetting.shared_drafts_enabled? && can_see_shared_draft?