Skip to content

Type Alias: SyncDefinitions<T, G> ​

ts
type SyncDefinitions<T, G> = T extends object ? 
  | GuardSyncDefinition<T, G>
  | readonly GuardSyncDefinition<T, G>[] : 
  | SyncDefinition<T>
  | readonly SyncDefinition<T>[];

Defined in: packages/core/src/sync.ts:59

What rbac.sync() takes: one definition or an array of them. Without per-guard names, SyncDefinition<T>, as in 1.0. With them, each block is checked against the names of its own guard (GuardSyncDefinition).

Type Parameters ​

Type ParameterDefault type
T extends RbacTypeConfigDefaultRbacTypes
G extends stringDefaultGuardName<T>

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