Merge pull request #680 from arlaneenalra/feature/fix-676
Force principalId to be a string in Role.getRoles Fix #676
This commit is contained in:
commit
03b3c3cda4
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue