mirror of
https://github.com/zulip/zulip.git
synced 2025-11-19 22:19:48 +00:00
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:
@@ -289,11 +289,17 @@ def fetch_initial_state_data(user_profile: UserProfile,
|
||||
state['stream_name_max_length'] = Stream.MAX_NAME_LENGTH
|
||||
state['stream_description_max_length'] = Stream.MAX_DESCRIPTION_LENGTH
|
||||
if want('default_streams'):
|
||||
state['realm_default_streams'] = streams_to_dicts_sorted(
|
||||
get_default_streams_for_realm(realm.id))
|
||||
if user_profile.is_guest:
|
||||
state['realm_default_streams'] = []
|
||||
else:
|
||||
state['realm_default_streams'] = streams_to_dicts_sorted(
|
||||
get_default_streams_for_realm(realm.id))
|
||||
if want('default_stream_groups'):
|
||||
state['realm_default_stream_groups'] = default_stream_groups_to_dicts_sorted(
|
||||
get_default_stream_groups(realm))
|
||||
if user_profile.is_guest:
|
||||
state['realm_default_stream_groups'] = []
|
||||
else:
|
||||
state['realm_default_stream_groups'] = default_stream_groups_to_dicts_sorted(
|
||||
get_default_stream_groups(realm))
|
||||
|
||||
if want('stop_words'):
|
||||
state['stop_words'] = read_stop_words()
|
||||
|
||||
Reference in New Issue
Block a user