Type Alias: ScopedGuard<T, G, K, O, C>
ts
type ScopedGuard<T, G, K, O, C> = <A>(...args) => RbacMiddleware<GuardSubject<T, G>, C>;Defined in: packages/trpc/src/guards.ts:173
A guard of createGuards<T, G>() when T has per-guard names (RbacTypeConfig['guards']): like Guard, but the names are those of the guard the call checks in, its { guard } option or else G (the guard of the subject). requirePermission('orders.read', { guard: 'api' }) takes the api names.
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends RbacTypeConfig | - |
G extends string | - |
K extends GuardKind | - |
O | - |
C | RbacProcedureContext |
Type Parameters
| Type Parameter |
|---|
A extends readonly (GuardNames | O)[] |
Parameters
| Parameter | Type |
|---|---|
...args | A & GuardRequirementArgs<A, T, K, G, O> |
Returns
RbacMiddleware<GuardSubject<T, G>, C>
