Last active
February 4, 2019 18:23
-
-
Save matthieugd/f040498d2a3d9b23025cc5bfbc2c5c2a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function applyCostPerimeter(userAttributes) { | |
if (userAttributes.hasOwnProperty('manually.admin') || userAttributes.hasOwnProperty('saml.admin')) { | |
return { | |
"costPerimeterDefinition" : null, | |
"roles" : ['ADMIN'], | |
}; | |
} else { | |
return { | |
"costPerimeterDefinition" : { | |
"BusinessUnit" : userAttributes['saml.businessunits'] //['backoffice-europe','backoffice-uk'] | |
}, | |
"roles" : ['USER'], | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment