I run an XPages application used by multiple companies. Some menu choices are only visible to system administrators and we often log in as those administrators to perform configuration and testing.
The problem is that sometimes we need to turn on/off other secret switches to help us with deeper application testing such as enabling/disabling debugging or showing/hiding menus that we only want to display when we are logged in and doing testing as a company administrator. These menus are not visible to normal administrators so that rules out Roles.
To make this a bit easier on us I create On/Off XPages that I enter into the URL when I want to enable/disable a session scope variable on demand. The XPage sets the session variable and returns us back the current XPage.
Not elegant but it really fits the bill.
Here is the code for a debugOff.xsp…we just enter it into the URL address whenever we need to disable the values and we use a corresponding XPage to enable the values.