I was trying to find where pop up windows inherits their security from and couldn’t find anything. Where is it inherited from? Having some issues with standard pop-up security.
Thanks
I was trying to find where pop up windows inherits their security from and couldn’t find anything. Where is it inherited from? Having some issues with standard pop-up security.
Thanks
Popup windows don’t inherit their security from anything. Each window has it’s own security setup. You can right-click on the window name in the Project Browser and select “Security” to set it up.
So if this is a pop-up I’m using over and over again in a project that will be used by different user groups what would the best practice be for doing security on it. Pass parameters from the button that opens it?
Is there another way to do it? The button thing would probably require having to pass things down a long chain of templates.
Thanks
Security in Ignition is based on the roles assigned to the currently logged in user, it isn’t passed around the project. You can require a role on any component in the project, check this video out for more on security: youtube.com/watch?v=xoCc0YZU-BQ
It looks a little different in Ignition 7.5+ but all the concepts are the same.
I understand that much and have it configured for 90% of the project - I will try and lay out the situation more clearly and see if you have any insight on the best way to do what I am trying to do.
I have a system with three areas or roles - one is in charge of booster stations, one is in charge of plants and one in charge of sources.
They can all view everything, but only ones assigned to their certain role are allowed to change set points for their system so only people part of the plant role can change process set points at the plant.
The security is set on all the windows and major pop ups for the roles, but I have several pop-ups that are not unique to each system/area. Any time they click on an analog device there is a button to bring up a pop-up that contains a template faceplate with a bunch of scaling values and setpoints. The template instance inherits its security from the window. I use the same pop-up through all three systems because I don’t want to create the same pop-up three times (or hundreds of times for larger systems). Something that Ignition has been very good at. So what I am trying to do is make the security on that pop-up dynamic so I can change the role depending on what system it has been opened in.
allenr8, can you not set the security on the button that brings up the popup that contains the faceplate so it won’t even open the popup if they don’t have permissions?
RRRancher - I could do that, but sometimes I want them to be able to open it and see what the values are set at and just disable the objects. Does that make sense?
In that case you will have to put the security in the button press script instead of on the component. That way you can pass your required role into the pop-up window. So your actionPerformed events will look like this: requiredRole = event.source.parent.requiredROle
if requiredRole in system.security.getRoles():
#your code here
Yes, it does. I would think you would have to either set permissions on all the components inside the popup so the user could have either read-only capability or full control capability, or create two templates, one for viewing only, and the other with the capability to make changes. There are probably other options too, but I can’t think of anything else right now.
I think I can take Bobby’s code and pass the roles that way and just have the objects set to disable only.
We will play with it. Bobby - this code resides on the button - can it pass the required roles to the object it is trying to open?
Like I want to open the pop-up, but have the buttons for entry disabled.
You would have to set the ‘enabled’ property to False on a visionWindowOpened event if you want to disable the buttons. But you can use basically the same script on that event and still reference the requiredRole value that you’ve passed in.
For more info on passing parameters check out our youtube videos.
Good info there Bobby. I’ll be checking it out soon. Thanks!
Is it just me or do those videos have no sound? Not that they really need them. I am already passing a bunch of parameters using that method - it is how I’m able to do these standard pop-ups be passing tag folders and such.
So what you are saying is from my button I can create a custom property for the button that holds the required roles for my button and pass that property as a parameter to my pop up and do the security through scripting on the buttons and check against that parameter right? Talk about a run on sentence sorry.
That is what I was wondering if I could do originally so I’m glad I was somewhat headed down the right track. I was just missing the custom property that holds the required roles - what data type should it be? String array I’m guessing.
That’s right, there is no sound in those videos.
And yes, you will want to use a string type property on the root container or your popup window.