Skip to main content

assignPermissionToRole

Requires permission settings:permission:update.

Grants a permission to a role. 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 AssignPermissionToRole($input: AssignPermissionInput!) {
assignPermissionToRole(input: $input)
}

Variables:

{
"input": {
"permissionId": "id",
"roleId": "id"
}
}

Response:

{
"data": {
"assignPermissionToRole": true
}
}
assignPermissionToRole(
input: AssignPermissionInput!
): Boolean!

Arguments​

assignPermissionToRole.input ● AssignPermissionInput! non-null input​

The role and the permission to grant.

Type​

Boolean scalar​

The Boolean scalar type represents true or false.