diff --git a/common/models/role.js b/common/models/role.js index 46e2101a..2c005cde 100644 --- a/common/models/role.js +++ b/common/models/role.js @@ -161,7 +161,8 @@ module.exports = function(Role) { } debug('Model found: %j', inst); var ownerId = inst.userId || inst.owner; - if (ownerId) { + // Ensure ownerId exists and is not a function/relation + if (ownerId && 'function' !== typeof ownerId) { if (callback) callback(null, matches(ownerId, userId)); return; } else {