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
{{ message }}
This repository was archived by the owner on Jun 25, 2025. It is now read-only.
there are user with admin role, manager role and operator role, some endpoint are accessible if user is admin or manager which different response and other endpoint are exclusively for manager role however the admin can also access it.
poweruser endpoint is a condition were user has x and y roles and there is not a condition where @requires("admin" or "poweruser") can access with either user have x scope or y scope.
@app.get('/poweruser') # Sample endpoint (secured)
@requires(["admin", "poweruser"]) # Requires the roles 'admin' and 'poweruser' (Will fail)
def poweruser(request: Request):
return request.user # Returns the user object that is injected into the request. The FastAPIUser in this case