GrantFn
GrantFn<
TUser,TTables> = <TSubject,TWith>(action,subject,options?) =>Grant
Defined in: packages/permissions/src/types.ts:307
Type-safe grant builder function, parameterized by the user type and an optional schema map.
Used when grants is provided as a callback in PermissionsConfig
so that where clauses receive a correctly typed user parameter and
string subjects are constrained to known table names from TTables.
Type Parameters
Section titled “Type Parameters”TUser
The user type passed to where clause callbacks.
TTables
Section titled “TTables”TTables extends SchemaMap = SchemaMap
Optional schema map (e.g. typeof schema) used to
constrain string subjects to known table-name literals.
Type Parameters
Section titled “Type Parameters”TSubject
Section titled “TSubject”TSubject extends SubjectInput<TTables>
TWith extends WithLookups<TUser> = WithLookups<TUser>
Parameters
Section titled “Parameters”action
Section titled “action”subject
Section titled “subject”TSubject
options?
Section titled “options?”where?
Section titled “where?”(columns, user, lookups) => DrizzleSQL | undefined
Row-level filter. The third argument exposes the resolved values from
with, keyed by the same names; pass an empty with map (or
omit it) when the filter does not need cross-table data.
TWith
Prerequisite lookups whose resolved values are passed to where via its third argument. See Grant.with.