Skip to content

Commit

Permalink
empty extra roles should be OK
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshawkes committed Nov 16, 2024
1 parent 00ae5e5 commit 83e3575
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions polytope_server/common/datasource/polytope.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,13 @@ def check_extra_roles(self, request) -> bool:
# if the user has any of the extra roles, they are allowed
realm = request.user.realm
req_extra_roles = self.extra_required_role.get(realm, [])

if len(req_extra_roles) == 0:
return True

logging.info(f"Checking for user roles in required extra roles: {req_extra_roles}")
logging.info(f"User roles: {request.user.roles}")

if any(role in req_extra_roles for role in request.user.roles):
return True
else:
Expand Down

0 comments on commit 83e3575

Please sign in to comment.