I’m having a tough time combining these two scripts. What I want is to limit who can edit a string input (using the touch screen keyboard) in the PLC based on their user role. These scripts work separately but having a problem getting them together. Is there an easier way?
roles = system.security.getRoles()
if 'Administrator' in roles or 'Operator' in roles:
value = 1
event.source.parent.enabled = value
event.source.enabled = 0
event.source.text = system.gui.showTouchscreenKeyboard(event.source.text)