Skip to content

Instantly share code, notes, and snippets.

@matthieugd
Last active February 4, 2019 18:23
Show Gist options
  • Save matthieugd/f040498d2a3d9b23025cc5bfbc2c5c2a to your computer and use it in GitHub Desktop.
Save matthieugd/f040498d2a3d9b23025cc5bfbc2c5c2a to your computer and use it in GitHub Desktop.
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