Enabled property and Security?

If you have Security on an object (button) configured to only allow a specific role, and also use the Enabled property linked to for example a tag, such that the button would be enabled only if an enabled tag were high. Does the Enabled property override the Security setting?
if i want to enable/disable the object based on both the tag value and the user role do i need to script that into the enabled propery?

Thanks,
Scott

Yes, the enabled property does override the security on the component. You can bind the enabled property to an expression that can do both:{Path/To/Tag} = 1 && lookup({[System]Client/User/RolesDataSet}, "Special Role", "", 0, 0) != ""Just replace “Special Role” with whatever role you are looking for. If you have more than one use && or ||.

You know, this is seems like it deserves some feature request attention. Can we maybe get an additional property or setting that will allow security to override the enable state?

That seems like a valid request. We should also have a special expression function to see if a user has a role.

The issue with security and enabled property conflicts has been solved with re-vamped component security in the upcoming 7.5 release.

What about this special expression function to see if a user has a role?

There is a “hasRole” expression that has been added into Ignition 7.7

You can maybe serve up your own function like this

put a custom string property on your root container like this

lookup({[System]Client/User/RolesDataSet},{Root Container.Numeric Label.rolerequired},"None", "Rolename")

Then put a custom property on your root container that holds the role that you want to check for. This funtion would return the rolename if it was available, or would return “none” if the user doesnt have that role available. Assuming that the roles dataset that is available works like I think it does, this should work for you.

Great! Thanks.

[quote=“diat150”]You can maybe serve up your own function like this

put a custom string property on your root container like this

lookup({[System]Client/User/RolesDataSet},{Root Container.Numeric Label.rolerequired},"None", "Rolename")

Then put a custom property on your root container that holds the role that you want to check for. This funtion would return the rolename if it was available, or would return “none” if the user doesnt have that role available. Assuming that the roles dataset that is available works like I think it does, this should work for you.[/quote]
Thanks! This is a bit similar to what Travis suggested earlier, but I like the idea of using custom properties.