mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
stream: Only realm admins can post to an announcement_only streams.
If a non-admin tries to post to an announcement_only stream, error message will be shown.
This commit is contained in:
committed by
Tim Abbott
parent
a5759108d3
commit
bb8577ba94
@@ -1937,6 +1937,9 @@ def check_message(sender: UserProfile, client: Client, addressee: Addressee,
|
||||
raise StreamDoesNotExistError(escape(stream_name))
|
||||
recipient = get_stream_recipient(stream.id)
|
||||
|
||||
if stream.is_announcement_only and not sender.is_realm_admin:
|
||||
raise JsonableError(_("Only organization administrators can send to this stream."))
|
||||
|
||||
if not stream.invite_only:
|
||||
# This is a public stream
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user