We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
strongloop-community/loopback-acl-route#3
I finally found this repo. Basically copy the code from this file https://github.com/strongloop/loopback/blob/9a33602458712afecedd25062f02bd8b5c4e01a5/test/role.test.js
Those two functions does not work. isInRole should be true
User.create({name: 'Raymond', email: '[email protected]', password: 'foobar'}, function(err, user) { console.log('Created user ', user) console.log('') Role.create({"name": "userRole", "ownerId": ObjectID(user.id)}, function(err, role) { console.log('Created role ', role) console.log(err) console.log('') role.principals.create({principalType: RoleMapping.USER, principalId: user.id}, function(err, p) { if (err) { console.log(err) throw err } console.log('Created principals') console.log(p) console.log('') Role.isInRole('userRole', {principalType: RoleMapping.USER, principalId: user.id}, function(err, isInRole) { console.log('Role.isInRole userRole') console.log(isInRole) console.log('') }) }) }) })
Mongodb
db.user.find() { "_id" : ObjectId("56340e2d8e142283754e0b84"), "password" : "$2a$10$9I6OAzexu4SCZo1GmbLO3eUaA6KJhhdd1hJAjbE3OVEM53V2LTQ/m", "email" : "[email protected]", "name" : "Raymond" }
db.role.find() { "_id" : ObjectId("56340e2d8e142283754e0b85"), "name" : "userRole", "ownerId" : ObjectId("56340e2d8e142283754e0b84"), "lastupdated" : ISODate("2015-10-31T00:41:17.257Z"), "created" : ISODate("2015-10-31T00:41:17.257Z"), "modified" : ISODate("2015-10-31T00:41:17.257Z") }
db.RoleMapping.find({}) { "_id" : ObjectId("56340e2d8e142283754e0b86"), "principalType" : "USER", "principalId" : "56340e2d8e142283754e0b84", "roleId" : ObjectId("56340e2d8e142283754e0b85") }
Need Help.
Many Thanks
The text was updated successfully, but these errors were encountered:
Duplicate of strongloop-community/loopback-acl-route#3
Sorry, something went wrong.
superkhau
No branches or pull requests
strongloop-community/loopback-acl-route#3
I finally found this repo. Basically copy the code from this file
https://github.com/strongloop/loopback/blob/9a33602458712afecedd25062f02bd8b5c4e01a5/test/role.test.js
Those two functions does not work. isInRole should be true
Mongodb
db.user.find()
{
"_id" : ObjectId("56340e2d8e142283754e0b84"),
"password" : "$2a$10$9I6OAzexu4SCZo1GmbLO3eUaA6KJhhdd1hJAjbE3OVEM53V2LTQ/m",
"email" : "[email protected]",
"name" : "Raymond"
}
db.role.find()
{
"_id" : ObjectId("56340e2d8e142283754e0b85"),
"name" : "userRole",
"ownerId" : ObjectId("56340e2d8e142283754e0b84"),
"lastupdated" : ISODate("2015-10-31T00:41:17.257Z"),
"created" : ISODate("2015-10-31T00:41:17.257Z"),
"modified" : ISODate("2015-10-31T00:41:17.257Z")
}
db.RoleMapping.find({})
{
"_id" : ObjectId("56340e2d8e142283754e0b86"),
"principalType" : "USER",
"principalId" : "56340e2d8e142283754e0b84",
"roleId" : ObjectId("56340e2d8e142283754e0b85")
}
Need Help.
Many Thanks
The text was updated successfully, but these errors were encountered: