Security Testing – Debugging when using restricted roles

Step 1:
Add the roles that you would like to test to your own user.
You also need to give yourself the role System administrator.
Step 2:
Open the development workspace.
Step 3:
Create a job and add following code.

static void nonAdminMode(Args _args)
{
    SecurityUtil::sysAdminMode(false);
}

Step 4:
Ctrl + W will open the workspace where you can simulate the issue.
At this moment you have reduced rights but you still have the possibility to debug.
Step 5:
When done testing & debugging close the session and run following job.

static void adminMode(Args _args)
{
    SecurityUtil::sysAdminMode(true);
}