From ff206a688c8216188598b4d9dc22589454916a54 Mon Sep 17 00:00:00 2001 From: Yang Zhou Date: Sat, 21 Apr 2018 22:34:18 +0800 Subject: [PATCH] fix a multiuser owership problem if principalType is 'Patient' and userModelName is 'Doctor' then callback is never called --- common/models/role.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/models/role.js b/common/models/role.js index 2b18b2b1b..9949d7c84 100644 --- a/common/models/role.js +++ b/common/models/role.js @@ -273,8 +273,8 @@ module.exports = function(Role) { process.nextTick(function() { callback(null, matches(modelId, userId)); }); + return callback.promise; } - return callback.promise; } modelClass.findById(modelId, options, function(err, inst) {