mirror of
https://github.com/zulip/zulip.git
synced 2025-10-26 09:34:02 +00:00
message_send: Fix old guests being treated as full members.
For streams in which only full members are allowed to post, we block guest users from posting there. Guests users were blocked from posting to admin only streams already. So now, guest users can only post to STREAM_POST_POLICY_EVERYONE streams. This is not a new feature but a bugfix which should have happened when implementing full member stream policy / guest users.
This commit is contained in:
@@ -184,6 +184,8 @@ def access_stream_for_send_message(sender: UserProfile,
|
||||
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_EVERYONE and sender.is_guest:
|
||||
raise JsonableError(_("Guests cannot send to this stream."))
|
||||
elif stream.stream_post_policy == Stream.STREAM_POST_POLICY_RESTRICT_NEW_MEMBERS:
|
||||
if sender.is_bot and (sender.bot_owner is not None and
|
||||
sender.bot_owner.is_new_member):
|
||||
|
||||
Reference in New Issue
Block a user