node_acl
node_acl copied to clipboard
regarding acl.mongodbbackend is not working
var db = mongoose.connection; var acl= new acl(new acl.mongodbBackend(db,'acl_',true),logger());
allowed permission: addroles.js acl.addUserRoles(req.query.userId, usersrole.role); acl.addUserRoles("51f46480-c681-11e5-a264-1d47180df7df","member");
tesrouter.js router.get('/updateProfile',addroles,acl.middleware(1,getuser_id),function (req, res, next) { try{ userprofilecontroller.updateUserProfile(req,res); next(); }catch(e){console.log(e);} });
in acl_resource collection haveing following data { "_id" : ObjectId("56ab7f59195d749d0908f329"), "meta" : "", "parents" : "", "permissions" : "get", "resources" : "/updateProfile", "roles" : "member", "users" : "51f46480-c681-11e5-a264-1d47180df7df" }
if i try this not working while i trace in **mongodb-backend.js ** the call is going upto following key 51f46480-c681-11e5-a264-1d47180df7df colletion name acl_resources searchParams { _bucketname: 'users', key: '51f46480-c681-11e5-a264-1d47180df7df' }
the call is not going into the following method ( In get : function(bucket, key, cb){..}) this.db.collection(this.prefix + collName,function(err,collection){..}
could you please tell, in which place i have done a mistake.
Issue fixed. issue was in acl_resources collection documents are not created. it is working fine... thank you..
Hi @rams0404
ACL with mongoose you have done with keystone demo or to custom app. can you do a post of steps which you tried
regards Nishanth skype: nishanthrajsh