Skip to content

Commit ce84d10

Browse files
committed
Fix room permission check
The `admin=False` here was checking for someone with moderator but not admin, which was wrong (and would not return rooms for admins): what we wanted instead if we don't need admin permission is `moderator=True, admin=None`.
1 parent bdeaf6b commit ce84d10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sogs/routes/users.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def extract_rooms_or_global(req, admin=True):
5555

5656
try:
5757
rooms = mroom.get_rooms_with_permission(
58-
g.user, tokens=room_tokens, moderator=True, admin=admin
58+
g.user, tokens=room_tokens, moderator=True, admin=True if admin else None
5959
)
6060
except Exception as e:
6161
# This is almost certainly a bad room token passed in:

0 commit comments

Comments
 (0)