Open macroramesh6 opened 7 years ago
I had the same problem, the issue is that you are effectively creating a role for every user rather than assigning a user to a role. I believe this is a valid use case but in your middleware check you are then querying for whether a user has the permission rather than whether the role has it. Instead you need to do this:-
acl.areAnyRolesAllowed('58344ca87f75a7306fc67645', '/api/guestbook', 'put', function(err, allowed){ console.log(err, allowed); //null, true });
I had the same problem.
It's a Promise,include allow and addUserRoles,use as this:
let allow = acl.allow([...]); allow.then(function(){ acl.addUserRoles() return Promise.resolve() }).then(function(){ acl.isAllowed() })
Thanks for the contribution for this package. I am new to this package I have added roles, resource, and permission. If I tried to use
isAllowed
returns null permission. my implementation is given below.Note: I have checked by removing
\
from the resource. the backend is redis connectionMy above check returns
null, false
it should benull, true
. Did I miss anything in my implementation? am I on the right path?