Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Find Role and Duty by X++ code

(0) ShareShare
ReportReport
Posted on by 207

Hi guys,

Hi  ,

I'm learning some tips on D365 security role.

I'm trying to reach Role and Duty in code but dont find anything on the subject.

Someone know how to do it ?

Thanksfully.

  • Awaxx Profile Picture
    Awaxx 207 on at
    RE: Find Role and Duty by X++ code

    Yes i got it now.

    I found a way to reach my goal too.

    Thank you for your help.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,969 Super User 2025 Season 1 on at
    RE: Find Role and Duty by X++ code

    Hi Mack,

    Alex showed the way how to interact with the class in coding. There is no object in the AOT which shows the contents of the message as it is a referenced dll. There is no documentation available for this dll. We learned it ourselves by trying out all methods and variables and look at how Microsoft is using it themselves.

  • Verified answer
    alexmeyer.itguy Profile Picture
    alexmeyer.itguy 648 on at
    RE: Find Role and Duty by X++ code

    Did you add in the required references?

    pastedimage1656512398877v1.png

  • Awaxx Profile Picture
    Awaxx 207 on at
    RE: Find Role and Duty by X++ code

    Hi Andre Arnaud de Calavon ,

    My business requirement are not so weird, just find a way to create a customize form to manage roles, duties and privileges. I know standard exist and do it well, but i just wanna train myself to find other ways to do it like tools you mentionned (Fastpath and S & C Studio).

    It's a way to discover security class and manipulate security datas.

    Thanksfully.

  • Awaxx Profile Picture
    Awaxx 207 on at
    RE: Find Role and Duty by X++ code

    Hello ,

    First, what i'm trying to do is to simplify form for managing roles, duties and privileges and improve my knowledge on the subject. I need to find a way to update my change on permission in privileges, for example changing the access for 'all customers' screen but by the code on a new customize security form.

    Secondly, I tried to reach SecurityRepository class, but didn't find it on the AOT.

    Where could i find it ?

    Thanksfully.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,969 Super User 2025 Season 1 on at
    RE: Find Role and Duty by X++ code

    Hi Mack,

    Like mentioned by Martin, first try to use the standard features. You only mentioned you want to change duties and privileges, but you didn't share the business requirement or gaps which might be identified. There are ISV solutions like Fastpath (mentioned by Alex) and Security & Compliance Studio from To-Increase which both offer more functionality compared to the standard.

  • alexmeyer.itguy Profile Picture
    alexmeyer.itguy 648 on at
    RE: Find Role and Duty by X++ code

    Mack,

    You will have to be more specific on what you are trying to do with the roles and duties you are referring to.

    If you are just wanting to query them, there are data entities available (SecurityRoles and SecurityDuties)

    pastedimage1656430079738v2.png

    pastedimage1656430130841v3.png

    Quick Edit:

    It looks like there was some discussion on this post after I started replying, based on your replies I can't answer directly as the company I work for (Fastpath) has a product that does just what you are asking for called Security Designer (https://www.gofastpath.com/grc-for-dynamics-365-fo#tab-7) so it would be under their IP.

    If you really want to go down this path, you can start by looking at the SecurityRepository class.

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,842 Most Valuable Professional on at
    RE: Find Role and Duty by X++ code

    Don't reivent the wheel - there already is standard GUI for this purpose. See System administration > Security > Security configuration.

    If you're missing something there, you can extend the standard solution. Don't try to create a parallel solution doing the same thing.

  • Awaxx Profile Picture
    Awaxx 207 on at
    RE: Find Role and Duty by X++ code

    I'm gonna try creating a custom form for security role attribution

  • Martin Dráb Profile Picture
    Martin Dráb 230,842 Most Valuable Professional on at
    RE: Find Role and Duty by X++ code

    What would be a reason for that?

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,969 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,842 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans