AX – D365FO – X++ Code to find all the privileges for a menu item in AX

Create this job to find all the privileges for a menu item

static void findAllThePrivilegeForSpecificMenuItem(Args _args)

{

    SecurityTask                          securityTask;

    SecuritySubTask                    securitySubTask;

    SecurityTaskEntryPoint          securityTaskEntryPoint;

    SecurableObject                    securableObject;

 

    while select * from SecurityTaskEntryPoint

              join    SecurableObject

             where SecurableObject.RecId == SecurityTaskEntryPoint.EntryPoint

              &&    SecurableObject.Name == menuitemOutputStr(TaxReport_IT_ERA) //your menu item


     {

 

              while select * from securityTask

                        where securityTask.RecId == SecurityTaskEntryPoint.SecurityTask

               {

                         info(strFmt("%1,%2,%3,%4", securityTask.AOTNAME, securityTask.Name,securityTask.Type,securityTaskEntryPoint.PermissionGroup));

                }

       }

}

One response to “AX – D365FO – X++ Code to find all the privileges for a menu item in AX”

  1. pete Avatar
    pete

    This is AX2012 code, right? What about D365fo, have you already upgraded this code?

    Like

Leave a comment