Skip to main content

updateRolePermissions

Requires permission settings:permission:update.

Replaces the full set of permissions on a role with the given list. Every permission being added must be one you hold yourself, and platform-reserved permissions are refused. Returns true on success. Needs settings:permission:update.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation UpdateRolePermissions($permissionIds: [ID!]!, $roleId: ID!) {
updateRolePermissions(permissionIds: $permissionIds, roleId: $roleId)
}

Variables:

{
"permissionIds": [
"id"
],
"roleId": "id"
}

Response:

{
"data": {
"updateRolePermissions": true
}
}
updateRolePermissions(
permissionIds: [ID!]!
roleId: ID!
): Boolean!

Arguments​

updateRolePermissions.permissionIds ● [ID!]! non-null scalar​

The IDs of the permissions the role should have after the update.

updateRolePermissions.roleId ● ID! non-null scalar​

The ID of the role.

Type​

Boolean scalar​

The Boolean scalar type represents true or false.