mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
spectators: Add comments and assertions on security model.
These tweaks help make reasoning about the spectators security model easier to understand.
This commit is contained in:
@@ -577,6 +577,12 @@ def fetch_initial_state_data(
|
||||
# abuse.
|
||||
state["giphy_api_key"] = settings.GIPHY_API_KEY if settings.GIPHY_API_KEY else ""
|
||||
|
||||
if user_profile is None:
|
||||
# To ensure we have the correct user state set.
|
||||
assert state["is_admin"] is False
|
||||
assert state["is_owner"] is False
|
||||
assert state["is_guest"] is True
|
||||
|
||||
return state
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user