OptimalBits / node_acl

Access control lists for node applications
2.62k stars 369 forks source link

Seems to do nothing... #220

Closed jasonburrows closed 7 years ago

jasonburrows commented 7 years ago

I can't get ACL to do anything at all (even throw an error):

acl = new acl(new acl.mongodbBackend(mongoose.connection.db, "acl_")); console.log("Testing ACL..."); acl.allow('guest', 'blogs', 'view'); acl.addUserRoles('joe', 'guest'); acl.isAllowed('joe', 'blogs', 'view', function(err, res){ if(res){ console.log("User joe is allowed to view blogs"); } else { console.log("Joe can't view blogs."); } }); console.log("Done testing..."); I've tried passing in 'joe', 'guest' - many different permutations.

Throws no errors, writes nothing to my database, doesn't output anything. I just get "Testing ACL..." and "Done testing..." to the console and the next thing I see is from other parts of my project (which all work fine and the DB access is working).

This is just a sample - I can call as many functions of acl that I like and nothing happens at all. Like literally nothing.

jasonburrows commented 7 years ago

Why was this closed with no comment? It's 100% reproducible.