Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mithem committed Jul 13, 2020
1 parent d4e7be1 commit 796f34e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion serverly/user/__init__.py
Expand Up @@ -275,7 +275,7 @@ def has_role(roles: Union[str, list]) -> bool:
users = serverly.user.get_all()
for u in users:
for role in roles:
if u.role == role or u.role in _role_hierarchy[u.role]:
if u.role == role or role in _role_hierarchy[u.role]:
return True
return False

Expand Down
2 changes: 1 addition & 1 deletion serverly/user/api.py
Expand Up @@ -724,7 +724,7 @@ def _console_api_renew_login(request: Request):
assert "hello" == "world", "oh yeah!"
assert request.auth_type.lower() == "basic"
user = serverly.user.get(request.user_cred[0])
assert user.role == "admin"
assert user.role == "admin" or "admin" in serverly.user._role_hierarchy[user.role]
serverly.user.authenticate(user.username, request.user_cred[1], True)
return Response()
except (AssertionError, serverly.err.UserNotFoundError, AttributeError, TypeError, serverly.err.NotAuthorizedError):
Expand Down

0 comments on commit 796f34e

Please sign in to comment.