mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 23:49:34 +08:00
FIX: access to category chat only when user can create post (#19488)
Previously, restricted category chat channel was available for all groups - even `readonly`. From now on, only user who belong to group with `create_post` or `full` permissions can access that chat channel.
This commit is contained in:

committed by
GitHub

parent
4adb457ced
commit
09d15d4c7f
@ -275,6 +275,12 @@ describe Chat::ChatNotifier do
|
||||
|
||||
include_examples "ensure only channel members are notified"
|
||||
|
||||
it 'calls guardian can_join_chat_channel?' do
|
||||
Guardian.any_instance.expects(:can_join_chat_channel?).at_least_once
|
||||
msg = build_cooked_msg("Hello @#{group.name} and @#{user_2.username}", user_1)
|
||||
to_notify = described_class.new(msg, msg.created_at).notify_new
|
||||
end
|
||||
|
||||
it "establishes a far-left precedence among group mentions" do
|
||||
Fabricate(
|
||||
:user_chat_channel_membership,
|
||||
|
Reference in New Issue
Block a user