Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fix explicit assignment of PL 0 from being misinterpreted in rare cir…
Browse files Browse the repository at this point in the history
…cumstances (#10499)
  • Loading branch information
reivilibre authored Jul 30, 2021
1 parent b7f7ca2 commit c167e09
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/10499.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug which caused an explicit assignment of power-level 0 to a user to be misinterpreted in rare circumstances.
2 changes: 1 addition & 1 deletion synapse/event_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ def get_user_power_level(user_id: str, auth_events: StateMap[EventBase]) -> int:
power_level_event = get_power_level_event(auth_events)
if power_level_event:
level = power_level_event.content.get("users", {}).get(user_id)
if not level:
if level is None:
level = power_level_event.content.get("users_default", 0)

if level is None:
Expand Down

0 comments on commit c167e09

Please sign in to comment.