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
|
// Set up the connection to users/applications/roles once the model
|
||||||
Role.once('dataSourceAttached', function () {
|
Role.once('dataSourceAttached', function () {
|
||||||
var roleMappingModel = this.RoleMapping || loopback.getModelByType(RoleMapping);
|
var roleMappingModel = this.RoleMapping || loopback.getModelByType(RoleMapping);
|
||||||
|
@ -338,7 +336,7 @@ Role.isInRole = function (role, context, callback) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var roleMappingModel = this.RoleMapping || RoleMapping;
|
var roleMappingModel = this.RoleMapping || loopback.getModelByType(RoleMapping);
|
||||||
this.findOne({where: {name: role}}, function (err, result) {
|
this.findOne({where: {name: role}}, function (err, result) {
|
||||||
if (err) {
|
if (err) {
|
||||||
callback && callback(err);
|
callback && callback(err);
|
||||||
|
|
Loading…
Reference in New Issue