Tuesday, September 17, 2013

 



NON-ADMIN Debugging in AX

 
Thank you Mr. Afsar khan.
 

Generally Non admin users cannot debug X++. To solve the issues for specific roles we need to debug what's going wrong. So, the following process helps to do that. The principle is the role will be given admin rights first, Then open the workspace, mark all breakpoints, and disable the admin rights for the current opened session through code. Open a new session by ctrl+w. This newly opened session will be without admin rights and still we made the system to hit the previously set break points.

 
1.) Add the admin to the roles that you want to test. Note that it is ok to leave the admin user in the system administration role.

2.) Open a dev workspace and close the application work spaces.

3.) Set applicable breakpoints.

4.) Create a job with the following line of code and execute: SecurityUtil::sysAdminMode(false);

5.) So at this point the current session is in "non-admin mode".

6.) Use Ctrl+W to open the application work space. You should notice that few menus / menu items are available

7.) Run the test and any break points set will be hit.

When SecurityUtil::sysAdminMode(…) is invoked, it is only applicable to the current session. So you must use CTRL+W to open the app workspace; launching a new client will not work.

No comments:

Post a Comment