# Switching Vision Window based on operator logon

**URL:** <https://forum.inductiveautomation.com/t/switching-vision-window-based-on-operator-logon/75915>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [July 5, 2023, 12:57am UTC](https://forum.inductiveautomation.com/t/switching-vision-window-based-on-operator-logon/75915 "2023-07-05T00:57:49Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![mandeep\_gill](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@mandeep\_gill](https://forum.inductiveautomation.com/u/mandeep_gill)\
**Post date:** [July 5, 2023, 12:57am UTC](https://forum.inductiveautomation.com/t/switching-vision-window-based-on-operator-logon/75915/1 "2023-07-05T00:57:49Z")

</div>

Hi Team,  
What is the best practice to open up different page when user login with supervisor logon. Same with menu bar or navigation bar.

Where should it be scripted on client scripts or any other way it can be achieved.

Is there document which highlight example scripts for this functionality.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [July 5, 2023, 5:08am UTC](https://forum.inductiveautomation.com/t/switching-vision-window-based-on-operator-logon/75915/2 "2023-07-05T05:08:11Z")

</div>

You're talking about navigating to a different starting window based on privilege level?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 5, 2023, 12:05pm UTC](https://forum.inductiveautomation.com/t/switching-vision-window-based-on-operator-logon/75915/3 "2023-07-05T12:05:19Z")

</div>

A common approach is to not have any window set to open on startup. Then, in the client startup script, examine the user roles and branch to an appropriate scripted window open call. This approach can also be used to open specific windows based on machine identity (MAC address is my preference).

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [July 5, 2023, 2:56pm UTC](https://forum.inductiveautomation.com/t/switching-vision-window-based-on-operator-logon/75915/4 "2023-07-05T14:56:49Z")

</div>

Is it recommended to make a separate project for each separate Vision client/HMI?

Do separate projects burden the Gateway more than using a client startup script to open specific windows for Vision?

I think it must be discussed at length somewhere, but I am not finding the topic(s) when I search.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 5, 2023, 4:09pm UTC](https://forum.inductiveautomation.com/t/switching-vision-window-based-on-operator-logon/75915/5 "2023-07-05T16:09:41Z")

</div>

> [@zacharyw.larson](#):
>
> Is it recommended to make a separate project for each separate Vision client/HMI?

I don't recommend it. I prefer to put all client-machine-specific possibilities in a single project so the client startup event can ask a database which window that client should start up with.

> [@zacharyw.larson](#):
>
> burden the Gateway more

Probably a wash. I would expect separate projects to be much more trouble to maintain, unless you used inheritance for nearly everything.

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [July 5, 2023, 5:40pm UTC](https://forum.inductiveautomation.com/t/switching-vision-window-based-on-operator-logon/75915/6 "2023-07-05T17:40:15Z")

</div>

Thanks

Thanks for this post too:

[Mobile Client MAC Address - #9 by jlivingston](https://forum.inductiveautomation.com/t/mobile-client-mac-address/23037/9)]  
I didn't understand it at first, but now that I used it, thanks so much.

```auto
# Call the function and print the MAC addresses
mac_addresses = myMacIds()
for mac in mac_addresses:
    print(mac)

```

I used this to print the addresses, but I could instead match and then open the window if I understand correctly. Thanks.

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [July 5, 2023, 8:11pm UTC](https://forum.inductiveautomation.com/t/switching-vision-window-based-on-operator-logon/75915/7 "2023-07-05T20:11:34Z")

</div>

@pturmel Am I wasting my time learning how to do things in Vision for my HMI?

Can I check the MAC address in Perspective?  
Or another way to restrict access to specific hardware in Perspective?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 5, 2023, 8:32pm UTC](https://forum.inductiveautomation.com/t/switching-vision-window-based-on-operator-logon/75915/8 "2023-07-05T20:32:02Z")

</div>

This is the among the things that Perspective cannot do.

See this somewhat recent topic:

> [@How things work - can perspective be used instead of vision or only as addition to it?](https://forum.inductiveautomation.com/t/how-things-work-can-perspective-be-used-instead-of-vision-or-only-as-addition-to-it/73688/5):
>
> What if you need to reliably lock down a particular operation to a client on a single computer? Behind a NAT? Perspective can't do it. Vision can. Vision can even probe its environment for things like motherboard serial numbers, if you have that need. What if you need to reliably handle a barcode scanner or RFID reader, or similar device, no matter what page the client is looking at? Perspective can't do it. Vision can. What if you need to use a physical security token with certificate …

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [July 5, 2023, 9:09pm UTC](https://forum.inductiveautomation.com/t/switching-vision-window-based-on-operator-logon/75915/9 "2023-07-05T21:09:35Z")

</div>

Thanks again.

---

<div class="post-metadata">

**Author:** ![mandeep\_gill](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@mandeep\_gill](https://forum.inductiveautomation.com/u/mandeep_gill)\
**Post date:** [July 6, 2023, 2:50am UTC](https://forum.inductiveautomation.com/t/switching-vision-window-based-on-operator-logon/75915/10 "2023-07-06T02:50:00Z")

</div>

Thanks Pturmel,  
Is there any example code which i can look into how the privilege level to open up the window.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [July 24, 2023, 8:46am UTC](https://forum.inductiveautomation.com/t/switching-vision-window-based-on-operator-logon/75915/11 "2023-07-24T08:46:54Z")

</div>

> [@mandeep\_gill](#):
>
> any example code which i can look into how the privilege level to open up the window.

Here is a thread on that topic:

> [@Check if a user is allowed to open a window before opening it](https://forum.inductiveautomation.com/t/check-if-a-user-is-allowed-to-open-a-window-before-opening-it/17956):
>
> I wonder if it’s possible to check if a user is allowed to open a window before opening it. Like that, we could disable or even hide buttons that would other wise navigate to an inaccessible screen, without having to give the user that annoying error popup. Just defining the rights twice is no option, as our navigation bar is multi-layered, so the same button can open different screens depending on what section is selected in the layer above.
