@fizz.js/node-acl
v1.0.0
Published
node-acl
Downloads
2
Readme
@fizz.js/node-acl
This is an acl library for express.
install
add dependencies
into package.json
and run yarn install
configure
please put acl
config into config/${env}.json
{
"acl": {
"prefix": "acl_",
"useSingle": true,
"v2": {
"baseUrl": "",
"filename": "acl.json",
"path": "config",
"defaultRole": "player",
"decodedObjectName": "user",
"roleSearchPath": "user.roles.name",
"rules": [
{
"group": "user",
"permissions": [
{
"resource": "test/*",
"methods": ["POST", "GET", "PUT"],
"action": "allow"
}
]
},
{
"group": "player",
"permissions": [
{
"resource": "error/*",
"methods": ["POST", "GET", "PUT"],
"action": "allow"
}
]
}
]
}
}
}
and you can also configure rules into ${path}/${filename}
(e.g. path/acl.json
) if you specified path
and filename
into config.
[
{
"group": "user",
"permissions": [
{
"resource": "test/*",
"methods": ["POST", "GET", "PUT"],
"action": "allow"
}
]
},
{
"group": "admin",
"permissions": [
{
"resource": "*/*",
"methods": ["POST", "GET", "PUT"],
"action": "allow"
}
]
}
]
test
yarn test
coverage
yarn cover
build
yarn build
docs
yarn docs