Options¶
Global Options¶
Global options can be passed on to the express-mongoose-acl object itself.
globalPermissions: seeQuick Start - Global PermissionspermissionField: the global permission field name, default to_permissionsidParam: the name ofRoute parameterthat is used to capture the document ID, default toid
Model Router Options¶
Router options can be passed on to the instance constructor or to the each setter methods.
baseUrllistHardLimitpermissionSchema: seeQuick Start - Permission SchemapermissionFieldmandatoryFieldsdocPermissions: seeQuick Start - Document PermissionsrouteGuard: seeQuick Start - Route GuardbaseQuery: seeQuick Start - Base Queryvalidate: seeMiddleware - Validateprepare: seeMiddleware - Preparetransform: seeMiddleware - Transformdecorate: seeMiddleware - DecoratedecorateAll: seeMiddleware - Decorate All-
identifier: this option defines howid paramis used to find the target document, defaults to_idfield; there is more than one way to define the relation:string: Mongoose document field keyfunction: Function returns a Mongoose query to find the target document.
userRouter.identifier(function (id) {
return { $or: [{ _id: id }, { code: id }] };
});