Skip to content

TemplateRoleInstance

Evaluates a Template Role against one Item at a time.

The Role’s handler derives, from the Item, the principals and App Roles that hold it; the active principal holds the Role when it is one of those principals or holds one of those App Roles. Sudo and system contexts hold every Role.

readonly prn: string

PRN that uniquely identifies this Role within the definition.

BaseRoleInstance.prn

assertRole(item): Promise<true>

Confirms that the active principal holds this Role on an Item.

unknown

The Item to evaluate the Role against.

Promise<true>

true when the Role is held.

AssertRoleFailedError when the active principal does not hold this Role on the Item.


checkRole(item): Promise<boolean>

Reports whether the active principal holds this Role on an Item.

unknown

The Item to evaluate the Role against.

Promise<boolean>