Skip to main content

Permission Model Reference

Scope​

This reference defines the data structures for permission evaluation requests and responses in the Authorization Decision Provider. It covers resource definitions, permission context attributes, and evaluation result types used when requesting authorization decisions.

Definitions​

TermDescription
ResourceA protected entity with a name and associated scopes
ScopeAn action that can be performed on a resource (e.g., read, write, delete)
Permission ContextAdditional attributes providing context for policy evaluation
Permission ResponseThe evaluation result for a single resource-scope combination
Evaluation ResultThe overall authorization decision (GRANT, DENY, or ERROR)

Allowed Values​

Evaluation Result Types​

ValueDescription
GRANTPermission is granted for the requested resource and scope
DENYPermission is denied for the requested resource and scope
ERRORAn error occurred during permission evaluation

Used By​


Diagram​


Request Structure​

PermissionEvaluateRequest​

The request payload for evaluating permissions.

FieldTypeRequiredDescription
clientIdStringYesThe client ID requesting the evaluation
resourcesList<Resource>YesList of resources with their scopes to evaluate
contextPermissionContextYesAdditional context for policy evaluation

Resource​

Defines a resource and its requested scopes.

FieldTypeRequiredDescription
nameStringYesThe name of the resource
scopesSet<String>YesSet of scopes to evaluate for the resource

PermissionContext​

Provides additional context for permission evaluation.

FieldTypeRequiredDescription
attributesPermissionContextAttributesYesObject containing context attributes

PermissionContextAttributes​

Attributes providing evaluation context.

FieldTypeRequiredDescription
bodyStringYesRequest body content as JSON string
headersStringYesRequest headers as JSON string
contextStringYesAdditional contextual data as JSON string
methodStringYesHTTP method (GET, POST, PUT, DELETE)
pathStringYesResource path being accessed
resourceStringYesResource metadata as JSON string

Response Structure​

PermissionEvaluateResponse​

The response payload containing evaluation results.

FieldTypeDescription
statusStringOverall evaluation result (GRANT, DENY, or ERROR)
permissionsSet<PermissionResponse>Individual results for each resource-scope combination

PermissionResponse​

Result for a single permission evaluation.

FieldTypeDescription
permissionStringThe resource name that was evaluated
statusIntegerNumeric status: 1 (GRANT), 2 (DENY), 3 (ERROR)

Minimal Example​

Request​

{
"clientId": "web-application",
"resources": [
{
"name": "documents",
"scopes": ["read", "write"]
}
],
"context": {
"attributes": {
"body": "{}",
"headers": "{\"authorization\":\"Bearer <token>\"}",
"context": "{\"ip\":\"192.0.2.1\"}",
"method": "GET",
"path": "/api/documents",
"resource": "{\"type\":\"document\",\"owner\":{\"id\":\"user_001\"}}"
}
}
}

Response (Granted)​

{
"status": "GRANT",
"permissions": [
{
"permission": "documents",
"status": 1
}
]
}

Invalid Example​

Missing required clientId field:

{
"resources": [
{
"name": "documents",
"scopes": ["read"]
}
],
"context": {
"attributes": {}
}
}

Error Response:

{
"error": "Bad Request",
"message": "clientId is required"
}

Status Codes​

CodeDescription
200Request processed successfully
400Invalid request payload or missing required fields
401Client is not authenticated
403Permission denied for all requested scopes

Notes​

  • All context attribute fields accept JSON strings, not parsed JSON objects
  • The status field in PermissionResponse uses numeric values (1, 2, 3) while the top-level status uses string values (GRANT, DENY, ERROR)
  • Each resource-scope combination is evaluated independently
  • The overall status reflects the aggregate result across all requested permissions
warning

Empty resources array or empty scopes for a resource will result in a 400 Bad Request error.

Next Step​

After understanding the permission model, implement authorization checks in your application using the Role & Authorization API.