Description

Learn how to set up security in an event script using the system.security.getRoles function. This function can be used in any script in Ignition that runs in a Client.

Video recorded using: Ignition 7.9

Transcript

(open in window)

[00:00] Security can be added to any of the event handlers in Ignition. And to demonstrate that, we're going to go and grab a button and put it on the screen here in the Designer. And now if I go into the Scripting for this button, then there's a bunch of different event handlers here, and we talk about that more in the Scripting section, but I'm going to choose my actionPerformed, and then just build a simple navigation script. So I'm going to tell it to open in center, maybe my popup window. And then if we look at the bottom here, you can see there are Action Qualifiers, and this one's Security. So I can say I want this to require the Administrator role, and then I'll click on Close here. And you can see now it's bold. And the reason that I've done this is it'll build the script for you and you can look at it over in the Script Editor section. And so here you can see it says if Administrator is in the system.security.getRoles function, then we're going to open inside of that window, right? So any of your scripts you can use this exact same system here, right, if administrator is in the list of roles that that particular user has, then we'll go ahead and do the script.

You are editing this transcript.

Make any corrections to improve this transcript. We'll review any changes before posting them.