FIX: Include admins in presence reply channel permissions (#14839)
Admins can see all regular topics, regardless of category permissions
This commit is contained in:
parent
d162229758
commit
8063489dc9
|
@ -23,7 +23,7 @@ after_initialize do
|
|||
config.allowed_user_ids = topic.allowed_users.pluck(:id)
|
||||
config.allowed_group_ids = topic.allowed_groups.pluck(:group_id) + [::Group::AUTO_GROUPS[:staff]]
|
||||
elsif secure_group_ids = topic.secure_group_ids
|
||||
config.allowed_group_ids = secure_group_ids
|
||||
config.allowed_group_ids = secure_group_ids + [::Group::AUTO_GROUPS[:admins]]
|
||||
else
|
||||
# config.public=true would make data available to anon, so use the tl0 group instead
|
||||
config.allowed_group_ids = [ ::Group::AUTO_GROUPS[:trust_level_0] ]
|
||||
|
|
|
@ -94,7 +94,7 @@ describe "discourse-presence" do
|
|||
it 'handles permissions for secure category topics' do
|
||||
c = PresenceChannel.new("/discourse-presence/reply/#{private_topic.id}")
|
||||
expect(c.config.public).to eq(false)
|
||||
expect(c.config.allowed_group_ids).to contain_exactly(group.id)
|
||||
expect(c.config.allowed_group_ids).to contain_exactly(group.id, Group::AUTO_GROUPS[:admins])
|
||||
expect(c.config.allowed_user_ids).to eq(nil)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue