This is a companion topic to Granular group-based permissions for anonymous and logged in users , and is a WIP.
There are still a few places in various codebases for core, plugins, and themes that directly reference everyone or (0) group ID directly, without taking into account this upcoming change, or without using user.in_any_groups? or various guardian methods used to deal with this.
For quick reference, some auto group IDs:
0-everyone1-admins2-moderators3-staff4-anonymous_users5-logged_in_users
This topic serves as a central place to keep track of fixes for this system as we approach stable. Custom plugins and themes for Discourse customers are not tracked here, I will have a separate list internally for this.
High priority issues
Issue raised by Moin:
- Core
- About -
apply_excluded_groupsonly is used to hide selected moderators & admins from the groups inabout_page_hidden_groups. It doesn’t make sense for pseudogroups like0|4|5to be used here, they should be added todisallowed_groups. We need to update the setting description too as it’s misleading.
- About -
Core plugins
- Discourse Templates
-
can_use_private_templates?still referenceseveryonedirectly and doesn’t use the_mapshorthand on site settings.
-
- Discourse AI
-
can_see_summary?in guardian extensions not usinguser.in_any_groups?
-
can_attach?in AiBot::Playground does not useuser.in_any_groups?
-
addTopicAdminMenuButtoninai-translation-topic-adminlooking atcurrentUser.groupson client, which is not reliable, do a server-side check forcontent_localization_allowed_groupsinstead
-
- Discourse Assign. Quite a lot of issues here.
- Rather than
user_ids_in_groupsinAssignmentPermissions, we should useuser_ids_in_groups assign_allowed_on_groupsshould have0|4|5added todisallowed_groups, none of these make sense here, it’s only concrete groups that matter.
- Rather than
Other plugins
- Activity Pub
- Remove
showStatusToUserclientside checking ofuser.groupsandeveryonecheck. Changeactivity_pub_post_status_visibility_groupsto default to4|5.
- Remove
- Suggested Edits
user_in_suggested_edits_group?needs to useuser.in_any_groups?inGuardianExtensions. Add1tosuggested_edits_review_groupsmandatory_groupsand remove admin special case incan_review_suggested_edits_in_topic_list- Add
0|4|5tosuggested_edits_review_groupsandsuggested_edits_suggest_groupsdisallowed_groups, this setting isn’t really intended to be used with these pseudogroups
- Resenha
- Remove the
untargetable_group_idsworkaround inpublic_room_message_bus_targetssince this was addressed in FIX: Handle new pseudogroups in message bus group IDs (#42610) · discourse/discourse@699ad46 · GitHub - Change
resenha_allowed_groupsdefault from0to4|5
- Remove the
Themes
Components
Low priority issues
- Core
is_in_edit_topic_groupsinTopicGuardianshould use the_mapextension for the site settingRoleable#whisperer?should useuser.in_any_groups?and get rid of admin check, add1towhispers_allowed_groupssetting asmandatory_values- Add
0|4todisallowed_groupsforallow_solved_in_groupssite setting, this deals with PMs only - Add
0|4|5todisallowed_groupsforabout_page_extra_groups, this is supposed to be dealing with concrete groups only on the about page - Note in
can_view?forPresenceChannelthat we need to remove theGroup::AUTO_GROUPS[:everyone]check when this upcoming change moves toPermanent
Core plugins
- Chat
- Note for
everyone_allowedin various places in chat auto-join/auto-leave logic andusers_with_unreadsto remove:everyonecheck when this upcoming change moves toPermanent - Update
chat_allowed_group_idsinChat::Publisherto remove special pseudogroup, as at FIX: Handle new pseudogroups in message bus group IDs - Pull Request #42610 - discourse/discourse - GitHub MessageBus can now deal with the pseudogroups correctly
- Note for
- Assign
- Get rid of
add_model_callback(Group)in plugin.rb, its irrelevant/dead code looking at group names instead of IDs
- Get rid of
Other plugins
- Code Review
can_review_code?check oncode_review_allowed_groupsdoesn’t use_mapextension and isn’t usinguser.in_any_groups?. Add1tomandatory_groupsfor the setting and get rid of special admin check in guardian. Add0|4|5todisallowed_groups.
- Needs Love
can_needs_love?check onneeds_love_allowed_groupsdoesn’t use_mapextension and isn’t usinguser.in_any_groups?. Add1tomandatory_groupsfor the setting and get rid of special admin check in guardian. Add0|4|5todisallowed_groups.
- Staff Alias
can_post_as_staff_aliascheck onstaff_alias_allowed_groupsdoesn’t use_mapextension and isn’t usinguser.in_any_groups?. Add0|4|5todisallowed_groups
Themes
Components
Next steps for migration
TBA