web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

rest api to get security roles on a record

(1) ShareShare
ReportReport
Posted on by 30
Is there a REST API to get all the security roles on a record? I want to see all the security roles which are currently active on a record from any entity.
I have the same question (0)
  • Suggested answer
    RudyZhang Profile Picture
    Microsoft Employee on at
    Hi,
     
    Our team analyzed your requirements, and according to the official Microsoft documentation, you can use the /Xrm.Utility.getGlobalContext().userSettings. roles/ method to get a collection of lookup objects that contain the GUID and display name of each security role assigned to the user, as well as to the team associated with the user's any security roles assigned to the user's associated team.

    As you use it, please note that this method is only supported on the Unified interface.
     
    The documentation is linked below
    https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/reference/xrm-utility/getglobalcontext/usersettings#roles
     
    In addition, the article at the following link has a simple sample code that will help you better understand and use this API.
    https://ajitpatra.com/2020/09/11/d365-ce-get-logged-in-users-security-roles-using-javascript/
     
     
     
     
    I hope my answer is helpful to you! If you have any other questions, please feel free to contact me.
     
    Best Regards,
    Rudy Zhang

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
iampranjal Profile Picture

iampranjal 68

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 53 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 40 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans