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 :
Microsoft Dynamics AX (Archived)

AX 2009 Modify security through X++

(0) ShareShare
ReportReport
Posted on by 66

Hi,

Can anyone please explain to me the difference between :

a) xAccessRightsList::saveSecurityRights(keySet.packTouched() , ...

and
b) xAccessRightsList::saveSecurityRights(keySet.pack()


I was under the impression that the "pack() contained the entire security key set", whereas the "packTouched( )" ony contains the security key items that have been modified, is that assumption correct? I've had some unexpected results running a job that modified security recently...

Consequently, if in an X++ job you read the security for a specific existing group and domain, and then you modify some permissions, and finally save the changes with xAccessRightsList::saveSecurityRights(keySet.packTouched() --> will only the modified permissions be kept, and all others will be reset to the permissions set on the parent ? Or will the original (non-modified) permissions be kept, and will only the modified permissions be updated ?

Alternatively, suppose you write a job in X++ that creates a new group, sets the domain, and sets "Edit" permission on a specific table and a few of the table fields, and "View permissions on all it's other table fields. When you save the security key set for this new group, will that security key set only contain the "edit" and "view" permissions on that specific table and it's table fields. Or will you inherit security from any parents (for simplicity assume the Admin domain has no access at all) ?

Is there any differency between saving with "xAccessRightsList::saveSecurityRights(keySet.pack(),..;" and "xAccessRightsList::saveSecurityRights(keySet.packTouched()" in this scenario ?

Thanks for any insights !

Gert

*This post is locked for comments

I have the same question (0)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 16

#2
GiacomoRovai Profile Picture

GiacomoRovai 4

#3
Douglas Noel Profile Picture

Douglas Noel 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans