# Hiding buttons based on logged in user

**URL:** <https://forum.inductiveautomation.com/t/hiding-buttons-based-on-logged-in-user/104195>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 25, 2025, 8:49pm UTC](https://forum.inductiveautomation.com/t/hiding-buttons-based-on-logged-in-user/104195 "2025-03-25T20:49:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![controls4689](https://avatars.discourse-cdn.com/v4/letter/c/e79b87/32.png) [@controls4689](https://forum.inductiveautomation.com/u/controls4689)\
**Post date:** [March 25, 2025, 8:49pm UTC](https://forum.inductiveautomation.com/t/hiding-buttons-based-on-logged-in-user/104195/1 "2025-03-25T20:49:10Z")

</div>

I am trying to hide a button based on if the engineer or operator is logged in, I used the expression 'hasRole("Administrator") binded to the visibility pictured below, but it is not visible when logged into either user, I am using the correct user source and spelling is correct. Any ideas would be helpful this has been frustrating

 ![Screenshot 2025-03-25 164822](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/e/be75344f8ed1306bda57ff46a19dd2715de66f7b.jpeg)

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [March 25, 2025, 8:51pm UTC](https://forum.inductiveautomation.com/t/hiding-buttons-based-on-logged-in-user/104195/2 "2025-03-25T20:51:02Z")

</div>

Try `isAuthorized` instead:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/9/29f117c3e2de2b89d3659590ecaa0137a1d0c1ac.png)

> **[isAuthorized | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/expression-functions/users/isAuthorized)**
>
> Returns a qualified value with a boolean value which is true if the user in the current Session is authorized, false otherwise.

---

<div class="post-metadata">

**Author:** ![controls4689](https://avatars.discourse-cdn.com/v4/letter/c/e79b87/32.png) [@controls4689](https://forum.inductiveautomation.com/u/controls4689)\
**Post date:** [March 25, 2025, 8:56pm UTC](https://forum.inductiveautomation.com/t/hiding-buttons-based-on-logged-in-user/104195/3 "2025-03-25T20:56:06Z")

</div>

yes that worked, that was a very fast response too, thank you.
