I was just trying the same thing (not sure about the merits in that), and I managed to connect using the MongoDB Driver.
You have to
npm install mongodb --save
and then, assuming you have in your config/connections.js
the following adapter information:
MyMongo: {
adapter: 'sails-mongo',
host: 'localhost', // defaults to `localhost` if omitted
port: 27017, // defaults to 27017 if omitted
user: '', // or omit if not relevant
password: '', // or omit if not relevant
database: 'someDB' // or omit if not relevant
},
You can now do the following:
var node_acl = require('acl');
var MongoClient = require('mongodb').MongoClient;
var dbInstance = "mongodb://"+sails.config.connections.MyMongo.host+":"+
sails.config.connections.MyMongo.port+"/"+sails.config.connections.MyMongo.database;
MongoClient.connect(dbInstance, function(error, db) {
//check for errors...
var mongoBackend = new node_acl.mongodbBackend(db, 'acl_');
var acl = new node_acl( mongoBackend );
acl.allow('role', 'model', 'action'); // Now you can do this...
}
I hope this helps. Notice I added the acl_
prefix so all the collections generated by ACL are discernible from other collections used by your models with sails.