Skip to content

PermissionsConfig

PermissionsConfig<TRoles, TUser, TTables> = object

Defined in: packages/permissions/src/types.ts:382

Configuration object for definePermissions.

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 extends SchemaMap = SchemaMap

Optional schema map used to constrain string subjects inside the grants callback to known table names.

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.


optional hierarchy: 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.