Announcements
No record found.
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.
What exactly do you mean by "to reach"? What are you trying to achieve?
I created some roles, duties and privileges in VS and wanna know how i could find it in code for some manipulation like inserting in custom table or another stuff.
So i was wondering how i could do that ?
You normally shouldn't do such a thing - that's the reason why existing code isn't full of such checks and why you can't find information on this subject.
Please tell us more about your business scenario. Maybe we can suggests a solution that won't depend on a particular role name or something like that.
My complete business scenario is to be able to create and modify privilege permissions in a chosen role but in x++ code
So my first goal is to reach the role by code and then it duty and the privilege in there
What would be a reason for that?
I'm gonna try creating a custom form for security role attribution
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.
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)
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.
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.
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 ?
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.
Congratulations to our 2026 Super Stars!
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 509 Super User 2026 Season 1
Giorgio Bonacorsi 375
Adis 268 Super User 2026 Season 1