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

One thought on “Get Security Roles of the User – Dynamics 365

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s