Tabstrip Security

Is there anyway to apply security to the individual tabs on a tabstrip?

Basically I want to disable a tab if the person does not have rights.

Ric Buehler

I don’t think you can achieve this without code. There are a couple of ways you can approach this, depending on whether you still want to use the built-in ‘Swap Windows’ navigation mode.

If you do, you can hide the tabs you don’t want the user to access. Do this by putting code in the internalFrameActivated event of the window to check the security groups of the logged-in user. Depending on which tabs you want to display, copy the tabstrip’s dataset, delete the appropriate lines and write the dataset back to the tabstrip. (You may have to copy the original full dataset to a dynamic property to avoid problems with caching.)

If you don’t need to use the ‘Swap Windows’ navigation mode, you can set the tabstrip mode to disabled and respond to changes of the tabstrip’s selectedTab property in code. You can then obviously do whatever you like in code.

Al, I couldn’t have said it better myself. :slight_smile:

If you want even more options, one other thing you can do is add security to the windows themselves. That way, when the swap function is called, the user will get an Access Denied message. This method won’t allow for something like hiding the tabs, but it also means you don’t have to do any scripting.

If you need your tabs to be really dynamic, you could bind the dataSet to an SQL query. One or more columns in the database like roles, level, access, etc, would determine which tabs to populate. You could achieve a similar effect with editing the dataSet directly via scripting (as mentioned).

As Bobby suggested, purely for the purposes of security, it’s cleanest and easiest to use Ignitions built in security at a Window level to protect access.