Get Current User Security Roles Using JavaScript In Microsoft Dynamics Crm

if you want to get logged in user security roles using JavaScript client api can you check code below. below getSecurityRolesofCurrentUser function will return roles array. add below code to your script file and call the function getSecurityRolesofCurrentUser.