FIX: Do not preview chat channels to read-only users (#21700)

We want to simplify this case as it contains a lot of rabbit holes.
This commit is contained in:
Jan Cernik
2023-05-24 09:05:20 -03:00
committed by GitHub
parent 4332f4b833
commit 436b68a581
5 changed files with 7 additions and 43 deletions

View File

@ -230,7 +230,7 @@ module Chat
end
raise Discourse::NotFound if chat_channel.blank?
raise Discourse::InvalidAccess if !guardian.can_preview_chat_channel?(chat_channel)
raise Discourse::InvalidAccess if !guardian.can_join_chat_channel?(chat_channel)
chat_channel
end
end