Type Alias: RoleRef<S>
RoleRef<
S> =object
Defined in: packages/polizy/src/role-registry.ts:38
A reference to a custom role. It is a normal { type, id } object (so it can
act as a subject) plus its originating tenant/name for convenience, and a
compile-time brand so a role can't be confused with an ordinary resource.
Pass it to registry methods. When using it as a raw subject in a direct
check, pass { type: role.type, id: role.id } — the extra fields are for
ergonomics, and the registry always writes bare tuples internally.
Type Parameters
S
S extends AnyRoleScaffoldedSchema
Properties
[ROLE_BRAND]
readonly[ROLE_BRAND]:true
Defined in: packages/polizy/src/role-registry.ts:43
id
id:
string
Defined in: packages/polizy/src/role-registry.ts:40
name
readonlyname:string
Defined in: packages/polizy/src/role-registry.ts:42
tenant
readonlytenant:AnyObject<SchemaObjectTypes<S>>
Defined in: packages/polizy/src/role-registry.ts:41
type
type:
SchemaObjectTypes<S>
Defined in: packages/polizy/src/role-registry.ts:39