mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 06:41:25 +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
@ -271,7 +271,7 @@ after_initialize do
|
||||
next if !chat_channel
|
||||
end
|
||||
|
||||
next if !Guardian.new.can_see_chat_channel?(chat_channel)
|
||||
next if !Guardian.new.can_preview_chat_channel?(chat_channel)
|
||||
|
||||
name = (chat_channel.name if chat_channel.name.present?)
|
||||
|
||||
@ -353,7 +353,7 @@ after_initialize do
|
||||
end
|
||||
end
|
||||
|
||||
next if !Guardian.new.can_see_chat_channel?(chat_channel)
|
||||
next if !Guardian.new.can_preview_chat_channel?(chat_channel)
|
||||
|
||||
{ url: url, title: title }
|
||||
end
|
||||
|
Reference in New Issue
Block a user