# How to allow a user to modify another user's app\_metadata?

**URL:** <https://community.auth0.com/t/how-to-allow-a-user-to-modify-another-users-app-metadata/8414>\
**Category:** Get Help\
**Tags:** spa, app\_metadata, management-api, angularjs\
**Created:** [October 7, 2017, 1:01am UTC](https://community.auth0.com/t/how-to-allow-a-user-to-modify-another-users-app-metadata/8414 "2017-10-07T01:01:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jordan.eliastam](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jordan.eliastam/32/5451_2.png) [@jordan.eliastam](https://community.auth0.com/u/jordan.eliastam)\
**Post date:** [October 7, 2017, 1:01am UTC](https://community.auth0.com/t/how-to-allow-a-user-to-modify-another-users-app-metadata/8414/1 "2017-10-07T01:01:12Z")

</div>

We need to allow a user with an elevated role to set/modify the role of other users. Currently we are storing their role in their app\_metadata. How can we allow someone to modify someone else’s app\_metadata from within our application?

We are have an SPA with angular v1.3, lock v10, auth0js v8.

---

<div class="post-metadata">

**Author:** ![prakharkumar79](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/prakharkumar79/32/7042_2.png) [@prakharkumar79](https://community.auth0.com/u/prakharkumar79)\
**Post date:** [October 9, 2017, 11:57am UTC](https://community.auth0.com/t/how-to-allow-a-user-to-modify-another-users-app-metadata/8414/2 "2017-10-09T11:57:31Z")

</div>

You can make use of Auth0 Management API’s [Update a user](https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id) endpoint to modify the user’s app\_metadata from within the application. You can put role based checks to only allow user with an elevated role to set/modify the role of other users.

---

<div class="post-metadata">

**Author:** ![jordan.eliastam](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jordan.eliastam/32/5451_2.png) [@jordan.eliastam](https://community.auth0.com/u/jordan.eliastam)\
**Post date:** [October 11, 2017, 1:25am UTC](https://community.auth0.com/t/how-to-allow-a-user-to-modify-another-users-app-metadata/8414/3 "2017-10-11T01:25:59Z")

</div>

Thanks for the response.

How would I go about implementing that without needing to store an API key somewhere on the frontend?

---

<div class="post-metadata">

**Author:** ![prakharkumar79](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/prakharkumar79/32/7042_2.png) [@prakharkumar79](https://community.auth0.com/u/prakharkumar79)\
**Post date:** [October 11, 2017, 10:21am UTC](https://community.auth0.com/t/how-to-allow-a-user-to-modify-another-users-app-metadata/8414/4 "2017-10-11T10:21:18Z")

</div>

You can store the API key and other info in a configuration file(a json file) and use gulp to generate an angular module of constants which can be used in the app without leaking potentially sensitive info into your repo. More details around this can be found [here](https://www.npmjs.com/package/gulp-ng-config).

---

<div class="post-metadata">

**Author:** ![jordan.eliastam](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jordan.eliastam/32/5451_2.png) [@jordan.eliastam](https://community.auth0.com/u/jordan.eliastam)\
**Post date:** [October 12, 2017, 10:53pm UTC](https://community.auth0.com/t/how-to-allow-a-user-to-modify-another-users-app-metadata/8414/5 "2017-10-12T22:53:56Z")

</div>

ok I came across this, which looks like a more secure alternative. We will probably use/mimic this implementation: [GitHub - twistedstream/auth0-user-management-service: A webtask service that allows "admin" users within an Auth0 account to manage other users](https://github.com/twistedstream/auth0-user-management-service)

Do you have any thoughts on it?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:56am UTC](https://community.auth0.com/t/how-to-allow-a-user-to-modify-another-users-app-metadata/8414/6 "2018-03-02T05:56:52Z")

</div>


