node.js - what is the best way to integrate node_acl with sails -
I want to use the module with framework. So I have configured Pal to use mongodb in this way: /config/connection.js
in mongodb: {adapter: 'sails-mongo', host: 'localhost' , Port: 27017, user: '', password: '', database: 'acl'}
and /config/models.js
{ Connection: In 'mongodb', migrate: 'safe'}
Now I have to configure the ACL module, so I have /api/controllers/AclController.js:
var ACL = requirement ('ACL'); ALCL = new ACL (new ACL.mongodb backend (DB Interstance, 'ACLC')); Module.exports = {addUserRoles: function (req, res) {acl.addUserRoles ('joed', 'guest', function (error, data) {return res.json ({err: err, errata: data});} ); }
How can I now get the value of dbInstance to instanciate ABC?
Note: I have established acl and sails-mongo dependencies ... Thank you for your help
The node_acl seems to depend on the mongoode driver, using different methods than the Pal ORM.
He said, you should be able to make 2 connections for your Mongo instance, through a node_acl library and one for a waterline / pal. Unless your sail models are correctly defined, they should be able to stay with the side. If you want you can also use your node_acl tables, and they can completely ignore them in the pal.
Comments
Post a Comment