Thursday, June 20, 2013

Non-admin debugging

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.

Post a Comment