Permissions Service

Check Resource Authorization

POST
Check whether the authenticated user is authorized to perform an action on the specified resource.

Request

This endpoint expects an object.
resource
objectRequired
The resource identifier for which you want to check authorization.
action
enumRequired
The action you want to perform on the resource.
Allowed values: READ
disableCache
booleanOptional
If specified, Credal will bypass the permissions cache and check current permissions for this resource

Response

This endpoint returns an object
authorized
boolean
POST
$curl -X POST https://api.credal.ai/api/v0/permissions/checkResourceAuthorization \
> -H "Authorization: Bearer <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "resource": {
> "resourceId": "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
> "resourceType": "GOOGLE_DRIVE"
> },
> "action": "READ"
>}'
Response
1{
2 "authorized": true
3}