# hasRole() expression error and system tag path error

**URL:** <https://forum.inductiveautomation.com/t/hasrole-expression-error-and-system-tag-path-error/82475>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [November 29, 2023, 1:18pm UTC](https://forum.inductiveautomation.com/t/hasrole-expression-error-and-system-tag-path-error/82475 "2023-11-29T13:18:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Why\_Me](https://avatars.discourse-cdn.com/v4/letter/w/b4bc9f/32.png) [@Why\_Me](https://forum.inductiveautomation.com/u/Why_Me)\
**Post date:** [November 29, 2023, 1:18pm UTC](https://forum.inductiveautomation.com/t/hasrole-expression-error-and-system-tag-path-error/82475/1 "2023-11-29T13:18:53Z")

</div>

I have an error using hasRole() using single arg..

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

If i input all args it seems to be ok but thats manually entering username..

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/7/b76d444594dded055a2f98f052f9f4482528186c.png)

so i then try to get the user name from the system tags and it returns null? Even though it is reading within that username tag

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/5/c5a1c6d7cb1ee00789d1a15105136e8ca0698176.png)

I have tried creating a reference tag of the system tag out of curiosity to see if i could bring the username over into my default tag list but it then says path not found?

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/e/5efd9d2a4ed416ca72516b67aed3e6cb7e6c008f.png)

---

<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:** [November 29, 2023, 1:21pm UTC](https://forum.inductiveautomation.com/t/hasrole-expression-error-and-system-tag-path-error/82475/2 "2023-11-29T13:21:06Z")

</div>

You are trying to use UI information in a global context. Tags don't have a user. They exist and execute whether anybody is connected or not, and regardless of how many are connected. You simply cannot use UI-specific information in an expression tag.

What are you really trying to do?

---

<div class="post-metadata">

**Author:** ![Why\_Me](https://avatars.discourse-cdn.com/v4/letter/w/b4bc9f/32.png) [@Why\_Me](https://forum.inductiveautomation.com/u/Why_Me)\
**Post date:** [November 29, 2023, 1:22pm UTC](https://forum.inductiveautomation.com/t/hasrole-expression-error-and-system-tag-path-error/82475/3 "2023-11-29T13:22:32Z")

</div>

Im trying to change an image on the screen depending on the roles applied to the current user

also create a list of tags with each of the roles that had a boolean value. I may need it later on in the project

---

<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:** [November 29, 2023, 1:24pm UTC](https://forum.inductiveautomation.com/t/hasrole-expression-error-and-system-tag-path-error/82475/4 "2023-11-29T13:24:27Z")

</div>

Use a root container custom property (boolean), with your ``hasRole()` expression. That runs in the client, and will be specific to that client. Use the resulting boolean in the components that need to change based on the role.

You can also use Vision Client Tags. These run in the client, too, and are client-specific.
