# User Rights for a button

**URL:** <https://forum.inductiveautomation.com/t/user-rights-for-a-button/105735>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [April 30, 2025, 2:56pm UTC](https://forum.inductiveautomation.com/t/user-rights-for-a-button/105735 "2025-04-30T14:56:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alfredo\_Egmo](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@Alfredo\_Egmo](https://forum.inductiveautomation.com/u/Alfredo_Egmo)\
**Post date:** [April 30, 2025, 2:56pm UTC](https://forum.inductiveautomation.com/t/user-rights-for-a-button/105735/1 "2025-04-30T14:56:08Z")

</div>

Is there a way to check for user rights at the time of press a button? I mean if a user press a button on a window, ask for user/password and only if the user has the proper rights execute the action?

---

<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:** [April 30, 2025, 3:10pm UTC](https://forum.inductiveautomation.com/t/user-rights-for-a-button/105735/2 "2025-04-30T15:10:17Z")

</div>

To disable the button you can use the built in security, to do a one off authentication challenge, you'll have to script it.

> **[Component and Window Security | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/vision/security-in-vision/component-and-window-security)**
>
> Role-based security inside of Vision works on multiple levels: component, group, container, and window levels. Each of these levels also have special categories of security that help with tuning security to various design considerations.

For general checking of the current roles of the user, the tag `[system]Client/User/RolesDataSet` contains the roles of the currently logged in user.

Your general flow would be to create a generic login popup for the auth challenge that has a  
parameter for a callback function name. This callback function should exist on the window containing the button that will request the challenge.

On submitting a login, the popup window should only validate the login and get the roles of the user, and then pass this information when calling the defined callback function. This callback function should have the decision making logic to determine what to do (either perform x action or toss a warning at the user that they don't have the rights to perform the action)
