Skip to content

Function: rbacSchemas() ​

ts
function rbacSchemas(): object;

Defined in: packages/mongoose/src/models.ts:101

Schemas (unregistered). Useful to add plugins or hooks before calling createRbacModels.

The return type is spelled out rather than inferred: the inferred one names internal Mongoose types that differ between Mongoose 8 and 9, and the published .d.ts must work with both.

Returns ​

object

NameTypeDefined in
modelHasPermissionSchema<ModelHasPermissionDoc>packages/mongoose/src/models.ts:106
modelHasRoleSchema<ModelHasRoleDoc>packages/mongoose/src/models.ts:105
permissionSchema<PermissionDoc>packages/mongoose/src/models.ts:102
roleSchema<RoleDoc>packages/mongoose/src/models.ts:103
roleHasPermissionSchema<RoleHasPermissionDoc>packages/mongoose/src/models.ts:104

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