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
I investigate this a bit. I did something similar. The command will not work till the mongodb established the connection. If you use the memorybackend, the same set of code will work. Still investigating a way to get around that.
I might have work around this issue.
Using the below, I initialize it within app.js in express. Then I require the acl where it is used.
I do not think this is a fool proof way, as it has a time component. If it takes longer than usual to establish the ACL backend, if someone hit the application before that is completed, an error will be thrown. So not solve yet. But usable for the moment. I need advise on this whoever can give.
//initACLs.js
var mongoose = require('mongoose');
var acl = require('acl');
//Piggy back on top of our connection to the DB by Mongoose.
acl = new acl(new acl.mongodbBackend(mongoose.connection.db, 'acl_'));
module.exports = acl;
//Where I need to perform the check - I used this in my default route
var acl = require('../libs/initACLs')
hello!
i´d like to add acls to my current app.
When I try to get the acl.middleware() in a route an error occurs: ^
How can I get it running? Is it possible to get a list with all users and their roles? And a list with roles and given relations?
The text was updated successfully, but these errors were encountered: