mirror of
https://github.com/discourse/discourse.git
synced 2026-08-04 10:39:43 +08:00
With the ACL changes that are ongoing, regular users need to be able to see the pseudogroups in certain situations, like the ACL group selection dropdown. Pseudogroups are the everyone, logged_in_users, and anonymous_users groups. They are currently limited to staff only, but this change will allow all logged on users to see them as well. This commit also does some minor fixes related to granular_anonymous_and_logged_in_groups_permissions upcoming change. If this is enabled, the everyone group should not be selectable in Site.groups in the UI, that will just lead to confusion in the long term especially because this upcoming change will eventually remove the everyone group.
14 lines
351 B
Ruby
Vendored
14 lines
351 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
Group.ensure_automatic_groups!
|
|
if g = Group.find_by(name: "trust_level_5", id: 15)
|
|
g.destroy!
|
|
end
|
|
|
|
Group.where(
|
|
id: [
|
|
Group::AUTO_GROUPS[:everyone],
|
|
Group::AUTO_GROUPS[:anonymous_users],
|
|
Group::AUTO_GROUPS[:logged_in_users],
|
|
],
|
|
).update_all(visibility_level: Group.visibility_levels[:logged_on_users])
|