Permissions Service

Check Resource Authorization For User

POST
Admin endpoint to check whether the specified 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
userEmail
stringRequired
The user email to check authorization for.
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/checkResourceAuthorizationForUser \
> -H "Authorization: Bearer <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "resource": {
> "resourceId": "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
> "resourceType": "GOOGLE_DRIVE"
> },
> "action": "READ",
> "userEmail": "john.smith@foo.com"
>}'
Response
1{
2 "authorized": true
3}