I'm trying retrieve the only User Security roles, but below code is retrieving the user security roles and team security roles as well. I want only User Security Roles.
Can we filter logged in user security roles, in MSCRM?
function GetUserRole() {
var roles = Xrm.Utility.getGlobalContext().userSettings.roles;
var hasRole = true;
roles.forEach(function (item) {
if (item.name.toLowerCase() === "technical team-security role") {
hasRole = false;
}
});
return hasRole;
}