A cloud-based identity and access management service for securing user authentication and resource access
the following article and approach can work for you
https://learn.microsoft.com/en-us/entra/identity/app-provisioning/expression-builder
you can use the AppRoleAssignmentsComplex expression to manage multiple roles and determine the highest priority role. Here is a concise approach to achieve this
maybe this expression can help you
AppRoleAssignmentsComplex(
appRoleAssignments,
{
if (any(appRoleAssignments, role -> role.displayName == "Admin")) {
return "Admin";
} else if (any(appRoleAssignments, role -> role.displayName == "Staff")) {
return "Staff";
} else if (any(appRoleAssignments, role -> role.displayName == "Team-Lead")) {
return "Team-Lead";
} else {
return "End-User";
}
}
)