You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var user1 = new User({ username: 'prince' });
user1.save();
user1.addRole('ops', function () {
console.log(require('util').inspect(user1.roles[0]));
});
}
)
}
This is creating 2 document in permission collection for read and create permission in mongo.
The text was updated successfully, but these errors were encountered:
My code is as below
var mongoose = require('mongoose')
, rbac = require('./lib/');
var db = mongoose.connect('mongodb://localhost/ecommerece_rbac');
if(db)
{
console.log("connected");
var UserSchema = mongoose.Schema({
});
UserSchema.plugin(rbac.plugin);
var User = mongoose.model('User', UserSchema);
rbac.init({
ops: [
['create', 'CallRecord'],
['read', 'CallRecord'],
['update', 'CallRecord'],
['delete', 'CallRecord']
],
callcenteragent: [
}, function (err, ops, callcenteragent) {
}
)
}
This is creating 2 document in permission collection for read and create permission in mongo.
The text was updated successfully, but these errors were encountered: