Fix the Role ref to RoleMapping
This commit is contained in:
parent
224b500c3a
commit
5586c54c49
|
@ -112,8 +112,6 @@ var Role = loopback.createModel('Role', RoleSchema, {
|
|||
}
|
||||
});
|
||||
|
||||
Role.RoleMapping = RoleMapping;
|
||||
|
||||
// Set up the connection to users/applications/roles once the model
|
||||
Role.once('dataSourceAttached', function () {
|
||||
var roleMappingModel = this.RoleMapping || loopback.getModelByType(RoleMapping);
|
||||
|
@ -338,7 +336,7 @@ Role.isInRole = function (role, context, callback) {
|
|||
return;
|
||||
}
|
||||
|
||||
var roleMappingModel = this.RoleMapping || RoleMapping;
|
||||
var roleMappingModel = this.RoleMapping || loopback.getModelByType(RoleMapping);
|
||||
this.findOne({where: {name: role}}, function (err, result) {
|
||||
if (err) {
|
||||
callback && callback(err);
|
||||
|
|
Loading…
Reference in New Issue