Skip to content

WriteAppRoleInstance

Assigns and revokes one App Role for users of the Workspace.

Role membership is stored on the user Item. The active principal’s own Roles are fixed for the duration of the execution, so assigning or revoking the current user takes effect from the next execution.

readonly prn: string

PRN that uniquely identifies this Role within the definition.

ReadAppRoleInstance.prn

assertRole(): true

Confirms that the active principal holds this Role.

true

true when the Role is held.

AssertRoleFailedError when the active principal does not hold this Role.

ReadAppRoleInstance.assertRole


assign(user): Promise<void>

Adds this Role to a user.

BaseIdentityUserItem | "current"

The user Item to assign, or 'current' for the active principal.

Promise<void>

Assigning a Role the user already holds leaves the assignment in place. 'current' is rejected in a system context, which has no principal.


checkRole(): boolean

Reports whether the active principal holds this Role.

boolean

ReadAppRoleInstance.checkRole


revoke(user): Promise<boolean>

Removes this Role from a user.

BaseIdentityUserItem

The user Item to revoke the Role from.

Promise<boolean>

true when the user held the Role and it was removed; false when the user did not hold it.