FEATURE: Allow TL4 users to see unlisted topics (#19890)

TL4 users can already list and unlist topics, but they can't see
the unlisted topics. This change brings this to par by allowing
TL4 users to also see unlisted topics.
This commit is contained in:
Ted Johansson
2023-01-17 16:50:15 +08:00
committed by GitHub
parent 341f93e0ba
commit 9cdeb93375
5 changed files with 34 additions and 8 deletions

View File

@@ -277,6 +277,10 @@ module TopicGuardian
)
end
def can_see_unlisted_topics?
is_staff? || @user.has_trust_level?(TrustLevel[4])
end
def can_get_access_to_topic?(topic)
topic&.access_topic_via_group.present? && authenticated?
end