Binding Enabled Property with Security

I’m wondering if there is a way to have both component security and another data source control the enabled property of a component like a button. In certain situations a button is not available for use so I’d like to have it still visible but disabled. I’d also like to disable it when the user doesn’t have the proper role. It seems that I can do either, but not both. If I use the component security feature to disable it and then also bind the enabled property, the binding wins and security has no effect. Is there some way to enable security and then access a security allowed property in an expression? If there were, maybe I could do an AND expression on the enabled binding.

You might want to use scripting to enable/disable the button based with the level of flexibility that you’re looking for.

Does the condition change quickly, or is it something that could be checked once on and determined on a window load (ie, do you expect to need to frequently poll for the change)? Please describe the “certain situation” more specifically.

-experts, when and how often is “security” evaluated on a Window - once when it loads, every time it opens, etc? More to the point, could you reasonably expect for security to work as you’d expect with scripts that show/hide or enable/disable those security enabled components? Or would you be better advised to just use scripting for those components?

A simple example is start/stop controls for a motor that can be in automatic or manual modes. In automatic mode, the start/stop buttons should be disabled. They should also be disabled when someone with insufficient security access is logged in. The auto/manual state doesn’t change often, but it could certainly be changed while the screen is being viewed (even by the operator from a selector on the screen as well as other control points).

Currently you can’t really do this.

I’m quite dissatisfied with how the security system uses the enabled property. It has never worked as well as I would have liked. I think we need to do an overhaul of the security system so that it goes through some other mechanism that can be more consistent across all components, and lets the enabled property function normally.

There is a ticket in our system to do this, but it probably won’t happen until after 7.3.