Sunday 26 April 2020

Get Security Roles of the User - Dynamics 365

Hi Everyone,

Today one of the Developer in my team was stuck with one issue and the issue was about validating users security roles and allowing the user to perform some operation. User was associated with only 2 security roles and the below line of code was giving 4 GUIDs. When we checked the code, whatever he was saying was correct. After few mins, we came to know that this line gets the roles of the Teams where user is associated along with roles that were given to the users.

Xrm.Utility.getGlobalContext().userSettings.securityRoles

Hope this helps.

--
Happy 365'ing
Gopinath

No comments:

Post a Comment