Skip to content

Scope check does not work if a security dependency has already occured #47

Open
@johnmartins

Description

@johnmartins

To replicate:

  • Create a user without an admin scope
  • Try deleting some other user

This happens because we have two instances of the security dependency. The first one, which is the one that is effective, is in the core router layer:

router.include_router(router_users, prefix='/users', tags=['users'], dependencies=[Security(verify_token)])

The second instance is in the router end-point definition:
dependencies=[Security(verify_token, scopes=['admin'])])

The second one does not have an effect. This error is present in multiple places. We need another method for asserting scoped permissions.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions