FIX: allow moderators to create categories setting broken

Mods require visibility to everyone group cause category dialogs need to
know about this.

If the site setting `allow moderators to create categories` will not function
without this

Note there is no security expansion of rights here, the group is technically
empty anyway and it always looks exactly the same on all discourse instances
This commit is contained in:
Sam 2019-03-06 17:44:08 +11:00
parent 1b1f9831b0
commit 8d7c10f7f2
2 changed files with 3 additions and 3 deletions

View File

@ -290,7 +290,7 @@ class Group < ActiveRecord::Base
# way to have the membership in a table
case name
when :everyone
group.visibility_level = Group.visibility_levels[:owners]
group.visibility_level = Group.visibility_levels[:staff]
group.save!
return group
when :moderators

View File

@ -221,9 +221,9 @@ describe Group do
end
describe '.refresh_automatic_group!' do
it "makes sure the everyone group is not visible" do
it "makes sure the everyone group is not visible except to staff" do
g = Group.refresh_automatic_group!(:everyone)
expect(g.visibility_level).to eq(Group.visibility_levels[:owners])
expect(g.visibility_level).to eq(Group.visibility_levels[:staff])
end
it "ensures that the moderators group is messageable by all" do