Sunday, September 5, 2010

How to modify the permissions of the Admin group

After creating a new security key you will need to modify the permissions of the Admin group, but the User group permissions form does not allow it.  This small AX job will grant the Admin group permissions to the new security key.

static void grantSafetyAccess(Args _args)
{
    #Admin
    SecurityKeySet  securitySet;
    ;
    setPrefix(funcName());
 
    securitySet = new SecurityKeySet();
    securitySet.loadGroupRights(#AdminUserGroup, '');
 
    securitySet.access(securitykeynum(MyNewSecurityKey), AccessType::Delete);
 
    xAccessRightsList::saveSecurityRights(securitySet.pack(), #AdminUserGroup, '');
}

1 comment:

  1. There is also a method in xAccessRightsList that will rebuild the Admin group:

    xAccessRightsList::createAdminitratorGroup();

    ReplyDelete