# What's best practice for managing users, roles and permissions in a web app?

**URL:** <https://community.auth0.com/t/whats-best-practice-for-managing-users-roles-and-permissions-in-a-web-app/136260>\
**Category:** Get Help\
**Tags:** users, management-api\
**Created:** [June 12, 2024, 11:19pm UTC](https://community.auth0.com/t/whats-best-practice-for-managing-users-roles-and-permissions-in-a-web-app/136260 "2024-06-12T23:19:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![larrybarry](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@larrybarry](https://community.auth0.com/u/larrybarry)\
**Post date:** [June 12, 2024, 11:19pm UTC](https://community.auth0.com/t/whats-best-practice-for-managing-users-roles-and-permissions-in-a-web-app/136260/1 "2024-06-12T23:19:40Z")

</div>

Is it a common practice to sync users, roles and permissions to your web app’s database or do people tend to call Auth0 APIs directly as the source of truth?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [June 13, 2024, 12:37am UTC](https://community.auth0.com/t/whats-best-practice-for-managing-users-roles-and-permissions-in-a-web-app/136260/3 "2024-06-13T00:37:30Z")

</div>

Hi @larrybarry,

Welcome to the Auth0 Community!

You should call the Auth0 Management API directly to get the user’s roles and permissions.

Alternatively, if you have configured your access token to append the user’s roles and permissions as custom claims, you can retrieve them by decoding the access token.

---

<div class="post-metadata">

**Author:** ![larrybarry](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@larrybarry](https://community.auth0.com/u/larrybarry)\
**Post date:** [June 13, 2024, 1:03am UTC](https://community.auth0.com/t/whats-best-practice-for-managing-users-roles-and-permissions-in-a-web-app/136260/4 "2024-06-13T01:03:00Z")

</div>

Thanks @rueben.tiow !

I noticed that there is native functionality for RBAC where the scopes get automatically added to the token (which is what I’m currently using). I didn’t see similar functionality for putting the actual role into the token. Am I missing that somewhere?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [June 13, 2024, 6:13pm UTC](https://community.auth0.com/t/whats-best-practice-for-managing-users-roles-and-permissions-in-a-web-app/136260/5 "2024-06-13T18:13:18Z")

</div>

Hi @larrybarry,

That’s correct! There is a feature in your [API settings](https://manage.auth0.com/#/apis) where you can enable the **Add Permissions in the Access Token** feature.

On the other hand, for Roles, you will need to use a post-login action script to append the roles as a custom claim to the access token.

Please see [this knowledge solution](https://community.auth0.com/t/how-can-i-use-the-management-api-in-actions/64947) on how to do so.

Let me know if you have any questions.

Thanks,  
Rueben

---

<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:** [June 27, 2024, 6:13pm UTC](https://community.auth0.com/t/whats-best-practice-for-managing-users-roles-and-permissions-in-a-web-app/136260/6 "2024-06-27T18:13:40Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
