You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ability to define a bulk ALLOW once a wildcard DENY is in place. #148
The way permissions are presently defined, a wildcard DENY trumps any acl does not exactly match on model, property, and accessType. While this is the technically correct solution, it would be nice to be able to setup a wildcard DENY for $everyone and then do a wildcard ALLOW for other roles.
I know this presents a problem with deciding which acl should have priority as there is currently nothing to assign a weight to roles or the acls themselves. Adding that should make this pretty simple to do.
This is tricky. I think everyone would agree that we need to err on the side of:
Ooops I accidentally denied that request
instead of
Uh oh... I accidentally allowed that request!
What would really help us define this solution is an example library / framework / platform that has this feature.
I think you are on the right track with weighting. Currently the order ACLs are defined do not matter.
I'm leaning towards a simpler approach: for more dynamic access control, you get a really handy hook so that you can ALLOW or DENY with javascript logic. Off the top of my head it would look like this:
Product.on('access',function(ctx){switch(ctx.type){case'read':
ctx.allow();break;case'write':
case'delete':
if(ctx.is('admin','owner')){ctx.allow();}else{ctx.deny();}break;default:
ctx.deny('you must be an admin or owner...');break;}});
A global hook would make it easy to define logic across models:
app.on('access',function(ctx){// also support asyncsetTimeout(function(){if(ctx.model==='SomeModel'){ctx.allow();}else{ctx.deny();}});});
Unfortunately, I don't have a good example ACL system ... hmm.
Having per-model and global hooks (I'd be more likely to use the global ones for what I'm doing) seems like it could be used to build what I'm looking for, but I'd have to handle role/acl configuration/definition in a custom manner... (Do able, just seems a bit unnecessary.)
changed the title [-]Feature Request: Ability to define a bulk ALLOW once a wildcard DENY is in place.[/-][+]Ability to define a bulk ALLOW once a wildcard DENY is in place.[/+]on Feb 4, 2016
As part of our issue triage process, I am closing items that have been inactive for an extended period of time. If anybody thinks the feature proposed here is still relevant and should be prioritised, then please leave a comment to let us know.
Activity
ritch commentedon Jan 20, 2014
This is tricky. I think everyone would agree that we need to err on the side of:
instead of
What would really help us define this solution is an example library / framework / platform that has this feature.
I think you are on the right track with weighting. Currently the order ACLs are defined do not matter.
I'm leaning towards a simpler approach: for more dynamic access control, you get a really handy hook so that you can ALLOW or DENY with javascript logic. Off the top of my head it would look like this:
A global hook would make it easy to define logic across models:
/cc @raymondfeng @bajtos
arlaneenalra commentedon Jan 21, 2014
Unfortunately, I don't have a good example ACL system ... hmm.
Having per-model and global hooks (I'd be more likely to use the global ones for what I'm doing) seems like it could be used to build what I'm looking for, but I'd have to handle role/acl configuration/definition in a custom manner... (Do able, just seems a bit unnecessary.)
raymondfeng commentedon Jul 23, 2014
In addition to the proposal to have method/model/global level hooks (+1), maybe we can set up the 'global' ACLs on base
ModelorPersistedModel?[-]Feature Request: Ability to define a bulk ALLOW once a wildcard DENY is in place.[/-][+]Ability to define a bulk ALLOW once a wildcard DENY is in place.[/+]bajtos commentedon Apr 7, 2016
As part of our issue triage process, I am closing items that have been inactive for an extended period of time. If anybody thinks the feature proposed here is still relevant and should be prioritised, then please leave a comment to let us know.