i'd like to use https://github.com/OptimalBits/node_acl module with http://sailsjs.org Framework. So I configured sails to use mongodb like this : In /config/connection.js
mongodb: {
adapter: 'sails-mongo',
host: 'localhost',
port: 27017,
user: '',
password: '',
database: 'acl'
}
And in /config/models.js
{
connection: 'mongodb',
migrate: 'safe'
}
Now I have to configure the acl module, so in /api/controllers/AclController.js i have :
var acl = require('acl');
acl = new acl(new acl.mongodbBackend(dbInstance, 'acl_'));
module.exports = {
addUserRoles : function(req, res) {
acl.addUserRoles('joed', 'guest', function(err,data){
return res.json({err:err, data:data});
});
}
Now how can I get the value of dbInstance to instanciate acl?
Note : I installed acl and sails-mongo dependencies... Thank you for your help