Dynamically hide/show Perspective Dock handle based on user roles

Hello everyone,

I’m using Ignition Perspective (8.1.47) with a Dock for navigation. In Page Configuration –> Shared Settings there is a feature autoHide Handle, but this setting appears to be static and not changeable at runtime.

My requirement is simple:

  • Some roles (e.g. Office/Admin) should see and use the Dock handle

  • Other roles (e.g. Operator/HMI) should not see the handle and should not be able to open the Dock

All users are active simultaneously, so this must be per-session and role-based, not global.

And my questions are:

  • Is there any supported way to dynamically control Dock handle visibility based on roles (Maybe access to Dock ID - look at the picture below)?

  • If Page Configuration cannot be changed at runtime, is the recommended approach to hide/disable a custom handle component instead?

Thanks for any guidance.

Pictures:

I don't think you'll be able to make this work cleanly. You should make a permanently accessible dock that includes or hides a nested view based on roles.

1 Like

I do this and use bindings to control what navigational components render based on the session's auth properties.

3 Likes

Not entirely sure if this would work but you could set the dock to on demand instead of auto or visible, then put a startup event on the pages that launches the dock only if they're authorized for certain roles.

Though on demand does close when navigating to new pages so I'm not sure how far that'll get you. If it has to re-launch each page that might feel buggy. But maybe it's worth a test to see if there's a route that way.

Alternatively you could play with the system.perspective.alterDock function to resize the dock down to 1 width for operator roles to effectively hide it? Though the handle would still show.

1 Like

Unclean!!

Actually reviewing the function you can config the handle to hide with alterDock. So perhaps that's an actual option. Set it to 1 width and hide the handle for operator accounts. Or even maybe just .closeDock will work, I can't test at the moment but I'd give those commands a shot.

1 Like

Thanks. Althought it is not some system solution, it worked with:

def runAction(self, event): system.perspective.alterDock('west', { 'handle': 'hide' } )

I can play with that onward, base it on the “roles” etc.

Thanks all for the guidance.

1 Like