Skip to content
This repository was archived by the owner on Jun 25, 2025. It is now read-only.
This repository was archived by the owner on Jun 25, 2025. It is now read-only.

EndPoint requires x or y scope #14

@dhernandezgt

Description

@dhernandezgt

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

can it have a develope for it please.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions