diff --git a/common/models/role.js b/common/models/role.js index a86dfcff..406389d9 100644 --- a/common/models/role.js +++ b/common/models/role.js @@ -353,7 +353,11 @@ module.exports = function(Role) { context.principals.forEach(function(p) { // Check against the role mappings var principalType = p.type || undefined; - var principalId = p.id || undefined; + var principalId = p.id == null ? undefined : p.id; + + if(typeof principalId !== 'string' && principalId != null) { + principalId = principalId.toString(); + } // Add the role itself if (principalType === RoleMapping.ROLE && principalId) {