From 8d7c10f7f2a13020ccd6af649509591d4aff9643 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 6 Mar 2019 17:44:08 +1100 Subject: [PATCH] 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 --- app/models/group.rb | 2 +- spec/models/group_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/group.rb b/app/models/group.rb index 0f2959048a3..65bc2c7fd49 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -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 diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb index 8419e89976c..c70570411b5 100644 --- a/spec/models/group_spec.rb +++ b/spec/models/group_spec.rb @@ -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