Sign in to follow this  
Followers 0
tpoirier

Custom navigation button / Macro to change display

3 posts in this topic

Hi all, I'm trying to improve the flow of an HMI (Panel View 1000) such that when a user taps a button and they do not have permission to that operation (change a value, navigate to a screen) the HMI would automatically take them to the login screen. My thought would be to create a tag in the background to establish who has access / permission that I can run a check against. I can setup another tag with a message that would change to tell the operator why the login screen appeared, something along the lines of "You must be logged in at a Supervisor level to complete this action". The part I can't seem to figure out is the actual button logic. Is there a way to create a macro that would handle something like navigation. The documentation I found show the macros being limited to simple options. What I was hoping for was some sort of button that ran a Macro along the following: User selects button to navigate to Maintenance Screen If userPermission = 1 Then goTo MaintenanceScreen1 Else goTo LoginScreen This method would require I code each button that has a restricted permission but I think the UI / operator interaction will be better, clearer for someone not familiar with the process. I'm open to other suggestions to accomplish this as well! Thanks in advance!

Share this post


Link to post
Share on other sites
Ok - So after some research it seems that you can supply a GoTo navigation button with a string value of a display. So what I'm thinking is to create a macro that runs on the login, that will set the navigation string to the appropriate screen or to the login screen based on the user type. I'll run the macro as a global connection macro and have it watch the isLogged in bit tag I created already. So user logs in, macro runs to assign the display values. User then can see all button options but when they hit a page without permissions it will force them to the login page. On logout the macro runs again resetting the permissions. I can also set my messages in the macro to tell the user why they ended up on the login screen instead of the desired screen.

Share this post


Link to post
Share on other sites
Have you tried the security expression CurrentUserHasCode()? You can use that with visibility animation to hide buttons that you want secured (ex. change value, GoTo screen). Put your login GoTo button behind the "secured" button. Users hate it when buttons disappear. If you do hide buttons, make sure that you put another "unsecured" button immediately behind it. That way if the user does not have security access, there is always something there.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0