I have a button that opens a window for technicians and supervisors, at the moment this button is hidden if the user logged in does not have the security rights to use the button and we log out and back in whenever we need open the window.
I want to display the button at all times and when it is clicked a check is made for the access rights. If the user has the rights to access the window then it should open and if not then a user should be able to login in to access the window.
When the window closes then I would like to switch back to the previous / default user so that access to the window is disabled again.
I was hoping to use a script similar to the one in the screen shot above, but instead of an error box I’d like the login box to appear.
Any ideas