mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: handles presence channel configured with everyone group (#20741)
This commit will allow any connected user to access a presence channel configured with the automatic group "everyone"
This commit is contained in:
@@ -104,6 +104,7 @@ class PresenceChannel
|
||||
return true if user_id && config.allowed_user_ids&.include?(user_id)
|
||||
|
||||
if user_id && config.allowed_group_ids.present?
|
||||
return true if config.allowed_group_ids.include?(Group::AUTO_GROUPS[:everyone])
|
||||
group_ids ||= GroupUser.where(user_id: user_id).pluck("group_id")
|
||||
return true if (group_ids & config.allowed_group_ids).present?
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user