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

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Suggested answer

Add security duties and privileges into roles using x++ without using security configuration tool

(1) ShareShare
ReportReport
Posted on by 5
Hello fellow D365 F&O professionals!
I am looking for some hints to perform a security configuration by using x++ but without using Security Configuration tool in the UI. Also, I’m NOT looking to create any new security objects in the AOT, so I would aim to strictly do configuring.
 
I would like to find a way to assign existing duties and privileges into a new role in the same way I would do by using a security configuration tool, but via x++.
 
I tried briefly to reverse engineer the code behind the Security Configuration form but found no apparent API for doing this. Maybe I would need to dig deeper, but meanwhile I would appreciate if you share your experiences on this matter. 

Thanks!
 
I have the same question (0)
  • Suggested answer
    Kevin Xia Profile Picture
    Microsoft Employee on at
    Add security duties and privileges into roles using x++ without using security configuration tool
    Hi Danem,
    According to the problem you described, it seems that you have a problem with adding user security permissions using X++ code, you can refer to this document: Code Example: SecurityUtil Class for Accessing Role and Object Permissions | Microsoft Learn.
    Best regards,
    Kevin
  • Martin Dráb Profile Picture
    236,974 Most Valuable Professional on at
    Add security duties and privileges into roles using x++ without using security configuration tool
    I've never done it and I would challenge the design, but it seems to me that the key parts are SysSecUnpublishedObjects table and SysSecPublishService class.

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Siv Sagar Profile Picture

Siv Sagar 268 Super User 2025 Season 2

#2
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 232

#3
Danny Bilodeau Profile Picture

Danny Bilodeau 214 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans