FEATURE: opt-in guidance on topics for users without access (#7852)

Co-Authored-By: majakomel <maja.komel@gmail.com>
Co-Authored-By: Robin Ward <robin.ward@gmail.com>
This commit is contained in:
Joffrey JAFFEUX
2019-07-04 10:12:39 +02:00
committed by GitHub
parent 5fdf228db6
commit 71bf9ec1b2
18 changed files with 638 additions and 457 deletions

View File

@@ -159,6 +159,10 @@ module TopicGuardian
can_see_topic?(topic, false)
end
def can_get_access_to_topic?(topic)
topic&.access_topic_via_group.present? && authenticated?
end
def filter_allowed_categories(records)
unless is_admin?
allowed_ids = allowed_category_ids