I have tried to switch the only supervisor role user using the following script but I'm not able to switch only supervisor role user.
Any idea how to fix this?
username = event.source.parent.getComponent("Username").text
password = event.source.parent.getComponent("Password").text
roles = system.user.getRoles("")
for role in roles:
if 'Supervisor' in roles:
system.security.switchUser(username, password, event)
elif 'Supervisor' not in roles:
system.gui.messageBox("Try again")