PermissionsConfig
PermissionsConfig<
TRoles,TUser,TTables> =object
Defined in: packages/permissions/src/types.ts:382
Configuration object for definePermissions.
Type Parameters
Section titled “Type Parameters”TRoles
Section titled “TRoles”TRoles extends readonly string[]
Tuple of role name string literals (use as const).
TUser = unknown
The user type for typed where clauses (defaults to unknown).
TTables
Section titled “TTables”TTables extends SchemaMap = SchemaMap
Optional schema map used to constrain string subjects
inside the grants callback to known table names.
Properties
Section titled “Properties”grants
Section titled “grants”grants:
Record<TRoles[number],Grant[]> | (grant) =>Record<TRoles[number],Grant[]>
Defined in: packages/permissions/src/types.ts:390
A map from role to grant arrays, or a callback that receives a typed grant function.
hierarchy?
Section titled “hierarchy?”
optionalhierarchy:Partial<Record<TRoles[number],TRoles[number][]>>
Defined in: packages/permissions/src/types.ts:394
Optional role hierarchy declaring which roles inherit from which.
roles:
TRoles
Defined in: packages/permissions/src/types.ts:388
All roles in the application, declared with as const for type inference.