Roles
Reference for the roles of your organization: the queries that read them, the mutations that create, update, and delete a role, and the IamRole type.
The roles of the caller's organization, the roles that can be assigned in the caller's workspace, and the mutations that create, replace, and delete a role.
Queries
roles
The roles of the caller's organization, inactive ones included, ordered by id.
roles(
first: Int
after: String
last: Int
before: String
): IamRoleConnection!Arguments
Output types:
role
One role of the caller's organization. Null when IAM has no such role there, or it was deleted.
Arguments
id
ID!
The role ID, as IAM issued it. IamRole isn't a Node, so node(id:) doesn't return a role: read it with role or roles.
Output types:
workspaceRoles
The active roles that can be assigned in the caller's workspace, ordered by id. A role created or changed moments ago can be missing for about a second.
Output types:
Mutations
roleCreate
Creates a role in the caller's organization.
Arguments
input
IamRoleCreateInput!
The input fields for the new role.
Input types:
Output types:
roleUpdate
Replaces a role's whole document: every field of the input replaces the stored one. See IamRoleUpdateInput.
Arguments
input
IamRoleUpdateInput!
The input fields for the role's new document.
Input types:
Output types:
roleDelete
Deletes a role and every assignment of it.
Arguments
input
IamRoleDeleteInput!
The input fields for the role to delete.
Input types:
Output types:
Objects
IamRole
A role of the caller's organization. A role belongs to one organization and reaches no other.
id
ID!
IAM's id for the role, the value role(id:) and every roleId take.
organizationId
ID!
The organization the role belongs to: the same value as ConsoleOrganization.id.
title
String!
The role's name.
description
String
The role's description. Null when it has none.
isActive
Boolean!
Whether the role can be assigned and grants anything. An inactive role is stored but grants nothing.
isSystem
Boolean!
Whether IAM provisioned and protects the role: the organization's Owner. roleUpdate and roleDelete refuse such a role with CONFLICT.
version
Int!
The version number for optimistic locking. Pass it to roleUpdate and roleDelete.
workspaces
The workspaces of the organization the role reaches, by workspace ID. It's empty when Navixy Console has deleted every workspace that the role named. Such a role reaches nothing, and roleUpdate accepts it only with a workspace named again.
holderCount
Long!
How many actors hold the role now, as IAM counts them: every principal type and every holder whose assignment has not expired, including people who have since left the organization or were invited and never joined. IAM holds assignments, not memberships. It can therefore be larger than the number of members a member list shows. 0 for an inactive role, which IAM does not count.
IamRolePayload
The role as IAM stored it.
IamRoleDeletePayload
The result of deleting a role.
deletedId
ID!
The id of the deleted role.
Inputs
IamRoleCreateInput
A new role, homed in the caller's organization. IAM refuses a role granting more than the caller's own roles do with PERMISSION_DENIED, dependencyCode GRANT_CEILING_EXCEEDED.
title
String!
The role's name.
description
String
The role's description. Omitted or null for none.
isActive
Boolean!
Whether the role can be assigned and grants anything.
workspaces
The workspaces of the organization the role reaches, by workspace ID. IAM refuses an empty selection and a workspace that the organization doesn't own. It checks the grant ceiling first and treats an empty selection as every workspace. So a caller whose own roles don't reach every workspace, or don't reach the named one, gets PERMISSION_DENIED with dependencyCode GRANT_CEILING_EXCEEDED. Any other caller gets VALIDATION_ERROR.
IamRoleUpdateInput
The whole new document of a role: every field replaces the stored one, so an omitted description removes it and an empty list empties it. There is no partial update. Refused with CONFLICT when version isn't the stored one, or when the role is a system role. Refused with PERMISSION_DENIED and dependencyCode GRANT_CEILING_EXCEEDED when the role as stored or as written grants more than your own roles do, so you can't change a role that you couldn't have granted, not even to narrow it. The same refusal applies when the role has holders and the change adds access that your own roles don't cover until the last holder's assignment ends.
id
ID!
The role to replace.
version
Int!
The role's version as last read.
title
String!
The role's name.
description
String
The role's description. Omitted or null removes it.
isActive
Boolean!
Whether the role can be assigned and grants anything.
workspaces
The workspaces of the organization the role reaches, by workspace ID. IAM refuses an empty selection and a workspace that the organization doesn't own. It checks the grant ceiling first and treats an empty selection as every workspace. So a caller whose own roles don't reach every workspace, or don't reach the named one, gets PERMISSION_DENIED with dependencyCode GRANT_CEILING_EXCEEDED. Any other caller gets VALIDATION_ERROR.
IamRoleDeleteInput
A role to delete. Refused with CONFLICT when version isn't the stored one, or when the role is a system role. Refused with PERMISSION_DENIED and dependencyCode GRANT_CEILING_EXCEEDED when you couldn't have granted the role. Deleting a role also revokes every assignment of it.
id
ID!
The role to delete.
version
Int!
The role's version as last read.
Pagination types
IamRoleConnection
A page of the roles of the caller's organization.
Implements: Connection
IamRoleEdge
An edge in an IamRoleConnection.
Implements: Edge
cursor
String!
An opaque cursor for this edge.
See also
Last updated
Was this helpful?