mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
FIX: whisper's presence channels (#30097)
In 0993273 we introduced the `whisper_allowed_group_ids` to allow whispers to more users than "staff". The presence plugin hadn't been updated to account for this change.
This commit is contained in:
@ -118,15 +118,20 @@ RSpec.describe "discourse-presence" do
|
||||
it "handles permissions for whispers" do
|
||||
c = PresenceChannel.new("/discourse-presence/whisper/#{public_topic.id}")
|
||||
expect(c.config.public).to eq(false)
|
||||
expect(c.config.allowed_group_ids).to contain_exactly(Group::AUTO_GROUPS[:staff])
|
||||
expect(c.config.allowed_group_ids).to contain_exactly(
|
||||
*SiteSetting.whispers_allowed_groups_map,
|
||||
)
|
||||
expect(c.config.allowed_user_ids).to eq(nil)
|
||||
end
|
||||
|
||||
it "only allows staff when editing whispers" do
|
||||
it "correctly allows whisperers when editing whispers" do
|
||||
p = Fabricate(:whisper, topic: public_topic, user: admin)
|
||||
c = PresenceChannel.new("/discourse-presence/edit/#{p.id}")
|
||||
expect(c.config.public).to eq(false)
|
||||
expect(c.config.allowed_group_ids).to contain_exactly(Group::AUTO_GROUPS[:staff])
|
||||
expect(c.config.allowed_group_ids).to contain_exactly(
|
||||
Group::AUTO_GROUPS[:staff],
|
||||
*SiteSetting.whispers_allowed_groups_map,
|
||||
)
|
||||
expect(c.config.allowed_user_ids).to eq(nil)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user