Options¶
Global Options¶
Global options can be passed on to the express-mongoose-acl
object itself.
globalPermissions
: seeQuick Start - Global Permissions
permissionField
: the global permission field name, default to_permissions
idParam
: the name ofRoute parameter
that 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.
baseUrl
listHardLimit
permissionSchema
: seeQuick Start - Permission Schema
permissionField
mandatoryFields
docPermissions
: seeQuick Start - Document Permissions
routeGuard
: seeQuick Start - Route Guard
baseQuery
: seeQuick Start - Base Query
validate
: seeMiddleware - Validate
prepare
: seeMiddleware - Prepare
transform
: seeMiddleware - Transform
decorate
: seeMiddleware - Decorate
decorateAll
: seeMiddleware - Decorate All
-
identifier
: this option defines howid param
is used to find the target document, defaults to_id
field; 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 }] };
});