guests: Block guest user access to default streams.

Guest users will just get an empty list of default streams; we also
hide the "Default streams" organization view from the guest users UI.

This is for consistency with not providing guest users the full list
of streams in an organization.
This commit is contained in:
Tim Abbott
2019-02-28 16:26:57 -08:00
parent 1ce0e8256b
commit 62dc6dda49
4 changed files with 38 additions and 6 deletions

View File

@@ -3650,14 +3650,14 @@ def notify_default_streams(realm: Realm) -> None:
type="default_streams",
default_streams=streams_to_dicts_sorted(get_default_streams_for_realm(realm.id))
)
send_event(realm, event, active_user_ids(realm.id))
send_event(realm, event, active_non_guest_user_ids(realm.id))
def notify_default_stream_groups(realm: Realm) -> None:
event = dict(
type="default_stream_groups",
default_stream_groups=default_stream_groups_to_dicts_sorted(get_default_stream_groups(realm))
)
send_event(realm, event, active_user_ids(realm.id))
send_event(realm, event, active_non_guest_user_ids(realm.id))
def do_add_default_stream(stream: Stream) -> None:
realm_id = stream.realm_id