Open ghost opened 8 years ago
Hey,
// I create a pastebin of the code: http://pastebin.com/2MVuMmM8 // I dont know why its not format here... with Mongo i do this:
mongoose.connect("mongodb://localhost:27017/xeorMain", function(err) { if (err) { console.log("ERROR"); } acl = new acl(new acl.mongodbBackend(mongoose.connection, 'acl_')); acl.allow('guest', 'blogs', 'view'); acl.allow('admin', 'blogs', 'edit'); });
mongoose.connect("mongodb://localhost:27017/xeorMain", function(err) { if (err) { console.log("ERROR");
} acl = new acl(new acl.mongodbBackend(mongoose.connection, 'acl_')); acl.allow('guest', 'blogs', 'view'); acl.allow('admin', 'blogs', 'edit');
});
and in mongoose i try this:
but this doesn't work. Is the acl param wrong with "mongoose.connection"?
Greetz
Do not use mongoose.connection as db instance - it has a type NativeConnection (realized interface MongooseConnection). The right way:
NativeConnection
MongooseConnection
javascript var acl = new ACL.mongodbBackend(mongoose.connection.db);
javascript
Hey,
// I create a pastebin of the code: http://pastebin.com/2MVuMmM8 // I dont know why its not format here... with Mongo i do this:
and in mongoose i try this:
but this doesn't work. Is the acl param wrong with "mongoose.connection"?
Greetz