# Need help for user management

**URL:** <https://forum.inductiveautomation.com/t/need-help-for-user-management/52035>\
**Category:** Ignition\
**Created:** [October 17, 2021, 2:14pm UTC](https://forum.inductiveautomation.com/t/need-help-for-user-management/52035 "2021-10-17T14:14:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![thiamweekhoo](https://avatars.discourse-cdn.com/v4/letter/t/e47c2d/32.png) [@thiamweekhoo](https://forum.inductiveautomation.com/u/thiamweekhoo)\
**Post date:** [October 17, 2021, 2:14pm UTC](https://forum.inductiveautomation.com/t/need-help-for-user-management/52035/1 "2021-10-17T14:14:27Z")

</div>

Hi, I have question on user management.  
I have 5 difference roles, Administrator, Manager, Supervisor, Operator and Guest.  
I wish to only allow the Administrator and Manager to be able to Add or Modify the user.  
My question is are there any way to not allow the Manager role to Add a new user with Administrator role ? i.e hide the Administrator role selection when i am logged in as Manager ?

Below is the expression i use to enable the User Management

**if ({[System]Client/User/RolesString}= “Administrator” || {[System]Client/User/RolesString}= “Manager”,1,0)**

Photo below showing that I am logged in as Manager but I can Add new user with Administrator.

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

Thanks and hope someone can help me on this.

---

<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:** [October 17, 2021, 4:38pm UTC](https://forum.inductiveautomation.com/t/need-help-for-user-management/52035/2 "2021-10-17T16:38:21Z")

</div>

A user can have multiple roles, so an equals comparison isn’t suitable. Consider using the [hasRole()](https://docs.inductiveautomation.com/display/DOC81/hasRole) expression function instead.

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [October 18, 2021, 2:28am UTC](https://forum.inductiveautomation.com/t/need-help-for-user-management/52035/3 "2021-10-18T02:28:38Z")

</div>

Everything is possible with Custom Methods. I remember I did this for a project a while ago. I think the name of the methods is filterRols

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [October 18, 2021, 3:47am UTC](https://forum.inductiveautomation.com/t/need-help-for-user-management/52035/4 "2021-10-18T03:47:15Z")

</div>

> [@jespinmartin1](#):
>
> Custom Methods

This sounds like you mean extension functions?

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [October 18, 2021, 3:50am UTC](https://forum.inductiveautomation.com/t/need-help-for-user-management/52035/5 "2021-10-18T03:50:34Z")

</div>

yeah that, haha

---

<div class="post-metadata">

**Author:** ![thiamweekhoo](https://avatars.discourse-cdn.com/v4/letter/t/e47c2d/32.png) [@thiamweekhoo](https://forum.inductiveautomation.com/u/thiamweekhoo)\
**Post date:** [October 18, 2021, 3:55am UTC](https://forum.inductiveautomation.com/t/need-help-for-user-management/52035/6 "2021-10-18T03:55:28Z")

</div>

the highest role i am assigning to my customer is Manager. but the problem is when I allow them to add new User, they can add a new user with Administrator role…which I want to prevent

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [October 18, 2021, 4:34am UTC](https://forum.inductiveautomation.com/t/need-help-for-user-management/52035/7 "2021-10-18T04:34:32Z")

</div>

@jespinmartin1 already answered this. You can use the `filterRole` extension function on the User Management component to filter out (hide) specific roles. E.g.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/0/a08d8bd4c5a0175ac885315b7a4d80825c8946bd.png)

---

<div class="post-metadata">

**Author:** ![thiamweekhoo](https://avatars.discourse-cdn.com/v4/letter/t/e47c2d/32.png) [@thiamweekhoo](https://forum.inductiveautomation.com/u/thiamweekhoo)\
**Post date:** [December 1, 2021, 4:05am UTC](https://forum.inductiveautomation.com/t/need-help-for-user-management/52035/8 "2021-12-01T04:05:46Z")

</div>

thank you guys 🙂
