Configure view permissions through scripting

Hi,
I was trying to grant user roles to the views through scripting. Is that possible?


I want to achieve this through scripting.

There is no way to configure View permissions through Scripting, because View permissions are not something that should change at runtime. If you need to change who can have access to a View, you should change that user’s permissions. Also, while you can perform logical checks against a user’s roles in Perspective, the screen you’re looking at is actually Security Levels. Security Levels are used very similarly to roles (which most Ignition users are familiar with), but they aren’t exactly the same.

Is there a way to navigate to that access denied screen? I want to do this via a script that is configured on every screen, instead of going to each screen (100+) and going through that configure view permissions menu.

access_denied

You could pretty easily set up a new Page Configuration, attach a View to that config, and apply unobtainable permissions to the View. Then place logic somewhere in either session props or on a change script which looks at a user's Security Levels and if they don't meet some requirements navigate them to this page. There's nothing to stop them from trying again, so you'd need to determine the best place/time to navigate them to this restricted Page.

That's a great idea, I can make that work. Thank you.