web
You’re offline. This is a read only version of the page.
close
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

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,049 Super User 2025 Season 2 on at

    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.

  • Gokulnath_March Profile Picture
    20 on at

    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,

  • Martin Dráb Profile Picture
    237,908 Most Valuable Professional on at

    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.

  • Verified answer
    André Arnaud de Calavon Profile Picture
    301,049 Super User 2025 Season 2 on at

    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. 

  • Gokulnath_March Profile Picture
    20 on at

    Hi @André Arnaud de Calavon ,

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

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

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans