Skip to main content

assignUserPermission

Requires permission settings:permission:update.

Grants a permission directly to a user. 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 AssignUserPermission($input: AssignUserPermissionInput!) {
assignUserPermission(input: $input)
}

Variables:

{
"input": {
"granted": true,
"permissionId": "id",
"userId": "id"
}
}

Response:

{
"data": {
"assignUserPermission": true
}
}
assignUserPermission(
input: AssignUserPermissionInput!
): Boolean!

Arguments​

assignUserPermission.input ● AssignUserPermissionInput! non-null input​

The user and the permission to grant.

Type​

Boolean scalar​

The Boolean scalar type represents true or false.