Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Retrieve the Roles assigned to current logged in user

(0) ShareShare
ReportReport
Posted on by 20

Hi all,

We are creating Canvas Apps using D365 Fin & Ops entity as a data source. We need to retrieve the Roles assigned to current logged in user. Below is the screenshot of D365 Fin & Ops User and Role association. Please suggest.

  pastedimage1675965146208v4.png

  • Gokulnath_March Profile Picture
    20 on at
    RE: Retrieve the Roles assigned to current logged in user

    Hi @André Arnaud de Calavon ,

    Thank-you for your suggestions. , I can get the logged in user roles using 'SecurityUserRole' table.

  • Verified answer
    André Arnaud de Calavon Profile Picture
    296,000 Super User 2025 Season 1 on at
    RE: Retrieve the Roles assigned to current logged in user

    Hi Gokulnath,

    This is fully different from what I did with my app. I would suggest using the standard security options from Power Apps for this purpose. Design - Securing the app and data - Power Apps | Microsoft Learn

    If you insist building your own security framework, you will need to find the user and the roles using the entities SystemUser and SecurityUserRole. 

  • Martin Dráb Profile Picture
    234,644 Most Valuable Professional on at
    RE: Retrieve the Roles assigned to current logged in user

    There are several ways how to do it. For example, there is a custom service for this purpose (SysUserManagement: getRolesForUser). And you can utilize UserSessionService to get the current user ID, if you don't know it.

  • Gokulnath_March Profile Picture
    20 on at
    RE: D365 Fin & Ops - Retrieve the Roles assigned to current logged in user

    Hi Andre Arnaud de Calavon 

    Thank- you for your response. We are not embedding the app within the Dynamics 365 F&O.

    It's the standalone Mobile app. (Canvas app) where we need to hide/show the screens and buttons based on current logged in user Roles.

    Thanks,

  • André Arnaud de Calavon Profile Picture
    296,000 Super User 2025 Season 1 on at
    RE: D365 Fin & Ops - Retrieve the Roles assigned to current logged in user

    Hi Gokulnath,

    For an internal demo, I created a canvas app this week having the security role assignments per user with additional information like assignment mode and license type. I would be happy to share my knowledge. Can you tell if you want to embed the app within Dynamics 365 F&O or would it be a stand alone app which should recognize the user? Please share the exact requirements for your app.

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

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 565

#2
Martin Dráb Profile Picture

Martin Dráb 536 Most Valuable Professional

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 402 Super User 2025 Season 1

Product updates

Dynamics 365 release plans