discourse/lib/guardian
Alan Guo Xiang Tan a473e352de
DEV: Introduce TopicGuardian#can_see_topic_ids method (#18692)
Before this commit, there was no way for us to efficiently check an
array of topics for which a user can see. Therefore, this commit
introduces the `TopicGuardian#can_see_topic_ids` method which accepts an
array of `Topic#id`s and filters out the ids which the user is not
allowed to see. The `TopicGuardian#can_see_topic_ids` method is meant to
maintain feature parity with `TopicGuardian#can_see_topic?` at all
times so a consistency check has been added in our tests to ensure that
`TopicGuardian#can_see_topic_ids` returns the same result as
`TopicGuardian#can_see_topic?`. In the near future, the plan is for us
to switch to `TopicGuardian#can_see_topic_ids` completely but I'm not
doing that in this commit as we have to be careful with the performance
impact of such a change.

This method is currently not being used in the current commit but will
be relied on in a subsequent commit.
2022-10-27 06:13:21 +08:00
..
bookmark_guardian.rb FEATURE: Promote polymorphic bookmarks to default and migrate (#16729) 2022-05-23 10:07:15 +10:00
category_guardian.rb FEATURE: Allow admins to permanently delete posts and topics (#14406) 2021-10-13 12:53:23 +03:00
ensure_magic.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
group_guardian.rb DEV: Remove usages of enable_personal_messages (#18437) 2022-10-05 10:50:20 +10:00
post_guardian.rb DEV: Remove usages of enable_personal_messages (#18437) 2022-10-05 10:50:20 +10:00
post_revision_guardian.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
tag_guardian.rb FEATURE: Introduce personal_message_enabled_groups setting (#18042) 2022-09-26 13:58:40 +10:00
topic_guardian.rb DEV: Introduce TopicGuardian#can_see_topic_ids method (#18692) 2022-10-27 06:13:21 +08:00
user_guardian.rb FEATURE: users with no posts shouldn't able to edit username after the allowed period. (#17583) 2022-07-21 04:46:15 +05:30