# Hide an object (button) based on user roles

**URL:** <https://forum.inductiveautomation.com/t/hide-an-object-button-based-on-user-roles/44143>\
**Category:** General Discussion\
**Created:** [March 5, 2021, 9:09am UTC](https://forum.inductiveautomation.com/t/hide-an-object-button-based-on-user-roles/44143 "2021-03-05T09:09:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tohhy-pm17](https://avatars.discourse-cdn.com/v4/letter/t/e19adc/32.png) [@tohhy-pm17](https://forum.inductiveautomation.com/u/tohhy-pm17)\
**Post date:** [March 5, 2021, 9:09am UTC](https://forum.inductiveautomation.com/t/hide-an-object-button-based-on-user-roles/44143/1 "2021-03-05T09:09:45Z")

</div>

Hi guys, have a good days.

Currently, I would like to hide one of the objects(button) based on the user roles. For instances, only Administrators are able to see the button but the other users that login with different roles are not able to see it.

In conclusion, may I know that is that any way to hide an objects which is a button in the Ignition based on the user roles.  
If YES, do I need to write the script or Ignition already have the function to work it ?

Thanks

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [March 5, 2021, 1:35pm UTC](https://forum.inductiveautomation.com/t/hide-an-object-button-based-on-user-roles/44143/2 "2021-03-05T13:35:34Z")

</div>

Couple ways to do this. You can utilize the `hasRole()` expression in a binding on the visiblity property. So the visibility property would look like  
`hasRole('Administrator')`.

You can also use the build in component security for this. Right click a component and select security (or use cntrl+e when the component is selected) and you will see Security Settings appear like this -  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/2/d23979fd966b83cca06f56f54aef8a33d442bd21.png)

If the container your component is in does not have the security settings you desire, uncheck “Inherit Permissions”, check off “Hide” since that is the default behavior you want the component to do, and the select “Administrator” under the exempt roles - they will be exempt from the component hiding.

As for which of these ways is preferable or better, I will leave that to someone else who more regularly uses security to answer.

---

<div class="post-metadata">

**Author:** ![Francisco\_Ochoa](https://avatars.discourse-cdn.com/v4/letter/f/e495f1/32.png) [@Francisco\_Ochoa](https://forum.inductiveautomation.com/u/Francisco_Ochoa)\
**Post date:** [July 24, 2024, 6:40pm UTC](https://forum.inductiveautomation.com/t/hide-an-object-button-based-on-user-roles/44143/4 "2024-07-24T18:40:06Z")

</div>

i tried to use your code but doesnt works

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/f/4fb7d77c46b147ddad80866c4b2c204118d2a43d.png)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [July 24, 2024, 6:43pm UTC](https://forum.inductiveautomation.com/t/hide-an-object-button-based-on-user-roles/44143/5 "2024-07-24T18:43:01Z")

</div>

What is the `Error_Configuration` message? (Hover over it.)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 24, 2024, 6:50pm UTC](https://forum.inductiveautomation.com/t/hide-an-object-button-based-on-user-roles/44143/6 "2024-07-24T18:50:12Z")

</div>

You're in Perspective. @bkarabinchak.psi's answer was for Vision.

---

<div class="post-metadata">

**Author:** ![Heather\_Murray](https://avatars.discourse-cdn.com/v4/letter/h/b9bd4f/32.png) [@Heather\_Murray](https://forum.inductiveautomation.com/u/Heather_Murray)\
**Post date:** [June 10, 2025, 6:24pm UTC](https://forum.inductiveautomation.com/t/hide-an-object-button-based-on-user-roles/44143/7 "2025-06-10T18:24:14Z")

</div>

Is role-based security in Perspective for a button opening a popup, not interacting with a tag, possible?

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [June 10, 2025, 7:01pm UTC](https://forum.inductiveautomation.com/t/hide-an-object-button-based-on-user-roles/44143/8 "2025-06-10T19:01:58Z")

</div>

Absolutely, you can add an expression binding to the component's `props.enabled` property to check if the user has a specific role using [`isAuthorized`](https://www.docs.inductiveautomation.com/docs/8.1/appendix/expression-functions/users/isAuthorized), and have it be enabled only if the user matches the role criteria.

You can also configure the popup's view to have a minimum role required to view it. [Security in Perspective | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/perspective/security-in-perspective#perspective-views-security)
