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

Announcements

No record found.

News and Announcements icon
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!
 
  • Suggested answer
    Kevin Xia Profile Picture
    Microsoft Employee on at
    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
    240,742 Most Valuable Professional on at
    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 99 Super User 2026 Season 2

#2
Paolo Cecchelli Profile Picture

Paolo Cecchelli 79 Super User 2026 Season 2

#3
Aayush Tiwari Profile Picture

Aayush Tiwari 71

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans