Our Admin API v2 enforces two layers of access control: permissions and scopes.
Both must be satisfied in order to access a resource.
Permissions
Permissions are tied to the user's role and account within Django.
They define what actions the user is fundamentally allowed to perform on a model or resource, regardless of the token being used.
- Example permissions:
accounts.view_accountaccounts.change_accountaccounts.delete_account
If a user does not have the required model permission, they cannot perform the action—even if their token includes the right scope.
Scopes (TokenHasResourceScope)
Scopes are tied to the authorization token that the client presents when calling the API.
They define the range of actions that the token can be used for, acting as an agreement between the client application and the API.
- Example scopes:
admin_api:accounts:readadmin_api:accounts:write
Even if a user has the correct Django permission, the request will be rejected unless the token also carries the required scope.
In short: Scopes answer the question:
➡️ "Does this token grant access to this type of operation in the API?"
How They Work Together
Both conditions must be true for a request to succeed:
- User Permissions → The user must have the appropriate Django permission (e.g.,
accounts.view_account). - Token Scopes → The token must include the matching scope (e.g.
admin_api:accounts:read).
This ensures principle of least privilege:
- A user cannot exceed their account-level authority.
- A token cannot be abused outside of its intended purpose.