Open snowdream opened 5 years ago
do nothing, go ahead your router without middleware
@xiemoumou I don't think that's what @snowdream means.
I believe they have a case where some resources require roles, but they need a role that has access to all resources.
One way to do this is to add this superadmin
role as a parent to all roles:
const acl = require('acl');
const memoryBackend = new acl.memoryBackend();
const aclInstance = new acl(memoryBackend);
aclInstance.addRoleParents('superadmin','admin');
aclInstance.addRoleParents('superadmin','customer');
aclInstance.addRoleParents('superadmin','agent');
aclInstance.addRoleParents('superadmin','finance');
aclInstance.addRoleParents('superadmin','content');
module.exports = aclInstance;
And use that instance for all your resources. I am sure there is a better way to achieve this, but this is one that works for now.
@AbdelrahmanHafez i'm sorry for my misunderstandingļ¼it works in your way.
hey, there is a new module for this, view it in https://github.com/xiemoumou/node_acl
@xiemoumou The link redirects to the current repo when clicked, people would need to copy & paste it in order to work, you probably need to edit it.
I need superadmin, who have all permissions on all the resources.
what can i do with node_acl?