Role assignments
Reference for role assignments in your organization: the queries that list them, the mutations that assign and revoke a role, and their types.
Who holds which role in the caller's organization: the roles a member holds, the holders of a role, and the mutations that assign and revoke a role.
Queries
memberRoles
The roles an actor holds in the caller's organization, in any of its workspaces. Expired assignments and roles since deactivated or deleted are left out. Empty for an actor holding none.
memberRoles(
actorId: UUID!
): [IamMemberRoleAssignment!]!Arguments
Output types:
roleHolders
Who holds a role, ordered by actor id, forward only. IAM does not know memberships, so the list includes every principal type and people who have since left or never joined; filter on principalType and on the organization's members as needed. Empty for a role that is inactive, deleted, or of another organization.
Arguments
roleId
ID!
IAM's id for the role.
last
Int
Refused with VALIDATION_ERROR: this list pages forward only.
before
String
Refused with VALIDATION_ERROR: this list pages forward only.
Output types:
Mutations
memberRoleAssign
Assigns a role to a member. IAM refuses the assignment in these cases, and the error has dependency: "iam":
A role ID that doesn't exist, or a role that was deleted:
NOT_FOUND.An actor who isn't a member of your organization:
CONFLICTwithdependencyCodeNOT_A_MEMBER. IAM checks this before the role.The Owner role, or another system role:
CONFLICTwithdependencyCodeSYSTEM_ROLE.A role that is inactive, belongs to another organization, or doesn't reach your workspace:
CONFLICTwithdependencyCodeFAILED_PRECONDITION.A role that you couldn't grant yourself, or an assignment that would last longer than your own access to the role:
PERMISSION_DENIEDwithdependencyCodeGRANT_CEILING_EXCEEDED. A permanent assignment needs your own access to the role to be permanent.
Arguments
input
IamMemberRoleAssignInput!
The input fields for the assignment.
Input types:
Output types:
memberRoleRevoke
Revokes a role from a member. IAM refuses the revocation in these cases, and the error has dependency: "iam":
The member doesn't hold the role:
NOT_FOUND.The revocation would leave the organization without an Owner:
CONFLICTwithdependencyCodeLAST_OWNER.A role that you couldn't grant yourself:
PERMISSION_DENIEDwithdependencyCodeGRANT_CEILING_EXCEEDED.
Arguments
input
IamMemberRoleRevokeInput!
The input fields for the revocation.
Input types:
Output types:
Objects
IamMemberRoleAssignment
One role a member holds in the caller's organization.
IamRoleHolder
One holder of a role.
actorId
UUID!
Console's ID for the user or API key that holds the role, the same value as ConsoleMember.actorId. It's a UUID, so node(id:) can't return a record for it. For a member of the organization it is the same id as ConsoleMember.actorId.
IamMemberRoleAssignPayload
The assignment as IAM stored it.
IamMemberRoleRevokePayload
The result of revoking a role.
roleId
ID!
The id of the revoked role.
Inputs
IamMemberRoleAssignInput
A role to give a member in the caller's organization and workspace. At most one of expiresAt and ttl; neither makes the assignment permanent. Assigning a role the actor already holds replaces its expiry.
actorId
UUID!
Console's id for the actor. IAM refuses an actor who is not a member of the organization.
roleId
ID!
The role to assign. It must be active and reach the caller's workspace.
IamMemberRoleRevokeInput
A role to take from a member in the caller's organization.
roleId
ID!
The role to revoke.
Enums
IamRolePrincipalType
What kind of principal holds a role, as IAM derives it from the actor id. UNKNOWN is a kind this schema does not name yet; treat it as not a person.
USER
A person.
API_KEY
An API key created in Console, which an agent or a script signs in with.
SYSTEM
IAM itself, for work that no person or API key started.
UNKNOWN
A kind of principal this schema does not name yet.
Pagination types
IamRoleHolderConnection
A page of the holders of one role.
Implements: Connection
total
Always null: IAM reports no total for this list. See IamRole.holderCount for its raw count.
IamRoleHolderEdge
An edge in an IamRoleHolderConnection.
Implements: Edge
cursor
String!
An opaque cursor for this edge.
See also
Last updated
Was this helpful?