Check user permission in project
const url = 'https://localhost:8080/api/v1/rbac/check/permission/example/project/example';const options = {method: 'GET', headers: {Authorization: '<Authorization>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://localhost:8080/api/v1/rbac/check/permission/example/project/example \ --header 'Authorization: <Authorization>'Report whether the authenticated user holds the given permission within the specified project
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Permission name
Project ID, UUID (bare or urn:uuid), or slug:my-project within the caller’s organization
Responses
Section titled “ Responses ”Permission check result; an unknown UUID or slug reports hasPermission false
Whether the caller holds the requested permission, echoing what was checked
object
The project reference as sent, or the project whose role granted the check
Example
{ "context": "organization", "hasPermission": true, "permission": "manage_org_settings", "projectId": "1", "userId": "550e8400-e29b-41d4-a716-446655440001"}Project ID is not an integer, a UUID, or a slug
Error body returned across the auth endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}Unauthorized - Authentication required
Error body returned across the auth endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}Project lookup failed
Error body returned across the auth endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}