mirror of
https://github.com/zulip/zulip.git
synced 2025-10-29 11:03:54 +00:00
streams: Add moderators option in stream_post_policy.
This commit adds a new option of STREAM_POST_POLICY_MODERATORS in stream_post_policy which will allow only realm admins and moderators to post in that stream.
This commit is contained in:
@@ -195,6 +195,13 @@ def check_stream_access_based_on_stream_post_policy(sender: UserProfile, stream:
|
||||
pass
|
||||
elif stream.stream_post_policy == Stream.STREAM_POST_POLICY_ADMINS:
|
||||
raise JsonableError(_("Only organization administrators can send to this stream."))
|
||||
elif (
|
||||
stream.stream_post_policy == Stream.STREAM_POST_POLICY_MODERATORS
|
||||
and not sender.is_moderator
|
||||
):
|
||||
raise JsonableError(
|
||||
_("Only organization administrators and moderators can send to this stream.")
|
||||
)
|
||||
elif stream.stream_post_policy != Stream.STREAM_POST_POLICY_EVERYONE and sender.is_guest:
|
||||
raise JsonableError(_("Guests cannot send to this stream."))
|
||||
elif (
|
||||
|
||||
Reference in New Issue
Block a user