@littlegauze/egg-node-acl
v1.0.3
Published
egg acl with mongodb
Downloads
2
Maintainers
Readme
egg-node-acl
Install
$ npm i @littlegauze/egg-node-acl --save
Usage
// {app_root}/config/plugin.js
exports.nodeAcl = {
enable: true,
package: 'egg-node-acl',
};
Configuration
// {app_root}/config/config.default.js
exports.nodeAcl = {
client: {
rules: [], // node-acl rules. { roles: [], allows: [] }
hierarchy: [], // node-acl parent map. { parent: 'admin', children: ['blog', 'account'] }
routes: {
prefix: '', // remove the prefix from path
ignore: [], // ignore pattern
match: [], // match pattern, route and resource map. { path: '/user', resource:
},
superAdmin: {
userId: 'userid', // default super admin add to db
roles: [ 'super' ], // default roles grant to user
},
},
insertMdwAt: 0, // node-acl middleware order inset appMiddleware.
};
see config/config.default.js for more detail.
Example
Questions & Suggestions
Please open an issue here.