# How do i update the roles a user has

**URL:** <https://forum.inductiveautomation.com/t/how-do-i-update-the-roles-a-user-has/56890>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 7, 2022, 7:09am UTC](https://forum.inductiveautomation.com/t/how-do-i-update-the-roles-a-user-has/56890 "2022-03-07T07:09:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![liam1](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@liam1](https://forum.inductiveautomation.com/u/liam1)\
**Post date:** [March 7, 2022, 7:09am UTC](https://forum.inductiveautomation.com/t/how-do-i-update-the-roles-a-user-has/56890/1 "2022-03-07T07:09:45Z")

</div>

Im working on a user management page, which is just replicating the user and roles page on the gateway.

Im working on the edit feature and I am trying to update the roles a users has.

Here is an example with the username “john” which has the following roles, ‘write’ and ‘read’.

Im trying to update his user profile to has no roles using the code below.

```auto
userToGet = system.user.getUser('operators', 'john')
userToGet.addRoles([])
system.user.editUser('operators', userToGet)

```

This does not work can some please assist

---

<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:** [March 7, 2022, 7:57am UTC](https://forum.inductiveautomation.com/t/how-do-i-update-the-roles-a-user-has/56890/2 "2022-03-07T07:57:51Z")

</div>

The work has already been done for you. Check out

> **[Ignition Exchange](https://inductiveautomation.com/exchange/2128/overview)**
>
> Discover, share, and download community made Ignition resources in collaboration with your organization or the Ignition community.

or the more basic

> **[Ignition Exchange](https://inductiveautomation.com/exchange/2243/overview)**
>
> Discover, share, and download community made Ignition resources in collaboration with your organization or the Ignition community.
