Skip to content

Type Alias: GuardSubject<T, G> ​

ts
type GuardSubject<T, G> = SubjectRbac<TypesOf<T>, ScopedGuardName<TypesOf<T>, G>>;

Defined in: packages/trpc/src/context.ts:23

The subject the guards of createGuards<T, G>() work with: a SubjectRbac with the names of T (of guard G with per-guard names), or an untyped SubjectRbac without T.

Type Parameters ​

Type ParameterDefault type
T extends RbacTypeConfig | Rbac<RbacTypeConfig>DefaultRbacTypes
G extends stringDefaultGuardName<TypesOf<T>>

Released under the MIT License. Inspired by spatie/laravel-permission.