Perform action depending on User Role

We are working on some HMI screens for a customer’s assembly line. In one of the projects, it has the status and settings for the line. We want to be able to have those settings usable dependent on the current logged on user’s role.

Our goal is for an admin to log on, and then be able to change all the settings he needs to. Also, for a technician to log on and see all the settings, but not be able to change them. These settings include multi-state buttons, text field inputs, and other misc. inputs, with most having some type of color to show what state that process is in. The overall project is fairly simple. I know I can tie the disable to the user’s role, but when disabled, all my buttons are grayed out and the colors won’t show up.

I am stuck on how to get this to happen, short of having multiple copies of screens that are accessible depending on the user.

Any help would be great

Zach

You can try putting the role check in scripting.

if "Admin" in system.security.getRoles():  #Admin as modify ability
	print "Modify"
else:  #Otherwise no modify ability
	print "No Modify"

Have you tried placing security on the components? Right click the component and then select security. The left field in the security window will be the roles that have all permissions. Any role not selected on the left will have the permissions on the right applied.