Define the roles available to an organization, the permissions attached to them, and the permissions a given member effectively holds.
List roles available to the organization the token was issued for, with role assignment configuration.
| query Roles { | |
| roles { | |
| multipleRolesEnabled | |
| roles { | |
| createdAt | |
| description | |
| id | |
| isDefault | |
| name | |
| slug | |
| updatedAt | |
| } | |
| } | |
| } |
| { | |
| "data": { | |
| "roles": { | |
| "multipleRolesEnabled": true, | |
| "roles": [ | |
| { | |
| "createdAt": "2024-01-01T00:00:00.000Z", | |
| "description": "description_example", | |
| "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY", | |
| "isDefault": true, | |
| "name": "name_example", | |
| "slug": "slug_example", | |
| "updatedAt": "2024-01-01T00:00:00.000Z" | |
| } | |
| ] | |
| } | |
| } | |
| } |
roles
Returns RolesResult!
Fetch a single role available to the organization the token was issued for.
| query Role($id: ID!) { | |
| role(id: $id) { | |
| createdAt | |
| description | |
| id | |
| isDefault | |
| name | |
| slug | |
| updatedAt | |
| } | |
| } |
| { | |
| "data": { | |
| "role": { | |
| "createdAt": "2024-01-01T00:00:00.000Z", | |
| "description": "description_example", | |
| "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY", | |
| "isDefault": true, | |
| "name": "name_example", | |
| "slug": "slug_example", | |
| "updatedAt": "2024-01-01T00:00:00.000Z" | |
| } | |
| } | |
| } |
role
Parameters
id: ID!
Returns Role
createdAt: DateTime!
description: String
id: ID!
name: String!
slug: String!
updatedAt: DateTime!
Create a role for the organization the token was issued for.
| mutation CreateRole($input: CreateRoleInput!) { | |
| createRole(input: $input) { | |
| createdAt | |
| description | |
| id | |
| isDefault | |
| name | |
| slug | |
| updatedAt | |
| } | |
| } |
| { | |
| "data": { | |
| "createRole": { | |
| "createdAt": "2024-01-01T00:00:00.000Z", | |
| "description": "description_example", | |
| "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY", | |
| "isDefault": true, | |
| "name": "name_example", | |
| "slug": "slug_example", | |
| "updatedAt": "2024-01-01T00:00:00.000Z" | |
| } | |
| } | |
| } |
createRole
Parameters CreateRoleInput!
Returns Role!
createdAt: DateTime!
description: String
id: ID!
name: String!
slug: String!
updatedAt: DateTime!
Update a role belonging to the organization the token was issued for.
| mutation UpdateRole($input: UpdateRoleInput!) { | |
| updateRole(input: $input) { | |
| createdAt | |
| description | |
| id | |
| isDefault | |
| name | |
| slug | |
| updatedAt | |
| } | |
| } |
| { | |
| "data": { | |
| "updateRole": { | |
| "createdAt": "2024-01-01T00:00:00.000Z", | |
| "description": "description_example", | |
| "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY", | |
| "isDefault": true, | |
| "name": "name_example", | |
| "slug": "slug_example", | |
| "updatedAt": "2024-01-01T00:00:00.000Z" | |
| } | |
| } | |
| } |
updateRole
Parameters UpdateRoleInput!
Returns Role!
createdAt: DateTime!
description: String
id: ID!
name: String!
slug: String!
updatedAt: DateTime!
Delete a role belonging to the organization the token was issued for.
| mutation DeleteRole($input: DeleteRoleInput!) { | |
| deleteRole(input: $input) { | |
| id | |
| } | |
| } |
| { | |
| "data": { | |
| "deleteRole": { | |
| "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY" | |
| } | |
| } | |
| } |
deleteRole
Parameters DeleteRoleInput!
Returns RoleDeleted!
List the permissions defined in the environment the token was issued for.
| query Permissions($after: String, $before: String, $limit: Int, $order: PaginationOrder, $search: String) { | |
| permissions(after: $after, before: $before, limit: $limit, order: $order, search: $search) { | |
| data { | |
| createdAt | |
| description | |
| id | |
| name | |
| slug | |
| system | |
| updatedAt | |
| } | |
| listMetadata { | |
| after | |
| before | |
| } | |
| } | |
| } |
| { | |
| "data": { | |
| "permissions": { | |
| "data": [ | |
| { | |
| "createdAt": "2024-01-01T00:00:00.000Z", | |
| "description": "description_example", | |
| "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY", | |
| "name": "name_example", | |
| "slug": "slug_example", | |
| "system": true, | |
| "updatedAt": "2024-01-01T00:00:00.000Z" | |
| } | |
| ], | |
| "listMetadata": { | |
| "after": "after_example", | |
| "before": "before_example" | |
| } | |
| } | |
| } | |
| } |
permissions
Parameters
after: String
before: String
limit: Int
Returns PermissionList!
The permissions a user effectively has in the organization the token was issued for, including permissions inherited through the user’s roles. Callers may read their own effective permissions; reading another member’s requires the elevated user:read grant.
| query EffectivePermissions($userId: ID!) { | |
| effectivePermissions(userId: $userId) { | |
| createdAt | |
| description | |
| id | |
| name | |
| slug | |
| system | |
| updatedAt | |
| } | |
| } |
| { | |
| "data": { | |
| "effectivePermissions": [ | |
| { | |
| "createdAt": "2024-01-01T00:00:00.000Z", | |
| "description": "description_example", | |
| "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY", | |
| "name": "name_example", | |
| "slug": "slug_example", | |
| "system": true, | |
| "updatedAt": "2024-01-01T00:00:00.000Z" | |
| } | |
| ] | |
| } | |
| } |
effectivePermissions
Parameters
userId: ID!
Returns [Permission!]!
createdAt: DateTime!
description: String
id: ID!
name: String!
slug: String!
updatedAt: DateTime!
Grant a permission to a role belonging to the organization the token was issued for.
| mutation AssignPermissionToRole($input: AssignPermissionToRoleInput!) { | |
| assignPermissionToRole(input: $input) { | |
| createdAt | |
| description | |
| id | |
| isDefault | |
| name | |
| slug | |
| updatedAt | |
| } | |
| } |
| { | |
| "data": { | |
| "assignPermissionToRole": { | |
| "createdAt": "2024-01-01T00:00:00.000Z", | |
| "description": "description_example", | |
| "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY", | |
| "isDefault": true, | |
| "name": "name_example", | |
| "slug": "slug_example", | |
| "updatedAt": "2024-01-01T00:00:00.000Z" | |
| } | |
| } | |
| } |