Skip to content

TemplateRoleCallback

TemplateRoleCallback = (item) => Promise<string[]>

Resolves who holds a Template Role for one Item.

ReadItem

Item whose Role membership is being resolved.

Promise<string[]>

Principal ids and App Role PRNs that hold the Role.

Return the access identifiers that hold the Role for item: principal Item ids, App Role PRNs, or both. The check passes when the current principal’s id is listed or the principal holds any listed App Role. The callback receives only the Item, so derive identifiers from its Properties and Relations.

An owner Role resolved from a Property

template.addRole('owner', async (item) => [String(item.properties.owner), adminRole.prn]);

TemplateBuilder.addRole