Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I need superadmin, what can i do with node_acl? #276

Open
snowdream opened this issue May 6, 2019 · 5 comments
Open

I need superadmin, what can i do with node_acl? #276

snowdream opened this issue May 6, 2019 · 5 comments

Comments

@snowdream
Copy link

snowdream commented May 6, 2019

I need superadmin, who have all permissions on all the resources.

what can i do with node_acl?

@xiemoumou
Copy link

do nothing, go ahead your router without middleware

@AbdelrahmanHafez
Copy link

@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.

@xiemoumou
Copy link

@AbdelrahmanHafez i'm sorry for my misunderstanding,it works in your way.

@xiemoumou
Copy link

hey, there is a new module for this, view it in https://github.com/xiemoumou/node_acl

@AbdelrahmanHafez
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants