Access
Preview

Ask whether the caller holds a permission on a scope

POST
/me/can-i
cookiebetter-auth.session_token<token>

Better Auth session cookie. Production uses the __Secure- prefixed name.

application/json
  1. body
permission*string
Length1 <= length
scope?

Response Body

The answer.

application/json
  1. response
allowed*boolean
reason?string

Why not, in words a person can act on.

via?string

What allowed it, in words a person can read: the role, the place it was granted on and how that place reaches the one asked about, such as an environment that holds the cluster.

Example Request
curl -X POST 'https://wardn.example.com/api/v1/me/can-i' \  -H 'Content-Type: application/json' \  -d '{  "permission": "release:approve"}'
Example Response
{  "allowed": true,  "reason": "string",  "via": "string"}