self.session.custom.auth.isOperatorInCharge
I have a custom session prop that is set to true when an operator signs in with an idp system and claims 1/2 operator seats available.
A security level checks if they have the role as an operator in the organization. I have a with 2 seats. When the operator claims a seat, their username is in one of those seats.
The username of the person signed into the page = 1 of the usernames on the tag, self.session.custom.auth.isOperatorInCharge is set to true.
I would like to make it so that the tags can only be edited if this session props is true.
Is there anyway to integrate custom session props into a security level?
No. Security levels are established only on login and are constants thereafter. You probably want to use a location-based Security Zone in combination with your role-based level.
Copy. That was my fallback. I will do that + have the buttons enabled or disabled based off of the custom session prop.
Is there a property or easy way to enable / disable clicking on a screen. Instead of disabling all the buttons, it would be simpler if I could apply a “disable click” property on a screen and it would apply to all the embedded views.
I'm not aware of any, no.
Try to apply as much of the logic as possible to Security Levels, so that tag writes from the client may be rejected no matter how the request was initiated (accidental binding on button-enablement, etc.). Note that a Security Level Rule may reference the value of a tag (number of seats claimed)...might be worth exploring?
As @pturmel mentioned, security levels are granted on login only. If this method is implemented, an otherwise-qualified operator would need to log in again in order to 'claim a seat' that was previously unavailable. If desired, an indicator stating that a seat is available should be easy enough to implement.
If security level grants can be utilized, and tag security assigned appropriately, then a button's enablement can be bound to the .CanWrite
property of the tag directly. A tooltip stating the reason why the button is disabled ("Insufficient Security Level", etc.) could be beneficial.
If you are using several of these buttons throughout your project, an embedded view of a 'template button' with the tag path passed into the view might be worth pursuing.