You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,6 @@
1
+
## 0.3.2
2
+
- Improvements to the admin role checks
3
+
- Fix an issue where the token for the auth0management endpoint for checking user roles would expire and cause requests to return less data than they should
"You have not been granted the necessary permissions to access to this resource. You are missing the following permissions: "+perms_needed, 403)
271
271
272
-
defcheck_for_role(role:str):
273
-
"""Performs a simple, stupid, name-based check against the roles that a user has.
272
+
defcheck_for_roles(roles:list, accept_any=True):
273
+
"""Performs a simple, stupid, name-based check against the roles that a user has.
274
+
275
+
This must be used after the @requires_auth decorator is applied
274
276
275
277
Args:
276
-
role (str): the name of the role to check if the user has
278
+
roles (list): a list of names of roles to check
279
+
accept_any (boolean): True to accept ANY of the provided roles. False to accept only ALL provided roles. Defaults to True.
277
280
278
281
Returns:
279
-
bool: true if the user has the role, false if they dont, and None if there is no currently authenticated user (this must be used after the @requires_auth decorator is applied)
282
+
bool: true if the user has any of the roles provided, false if the user has none of them, and None if there is no currently authenticated user
280
283
"""
281
284
user_id=get_api_user_id()
282
285
#TODO: make management API optional and check if it is present
0 commit comments