# How to set user rules and roles with mongodb as custom database

**URL:** <https://community.auth0.com/t/how-to-set-user-rules-and-roles-with-mongodb-as-custom-database/98688>\
**Category:** Get Help\
**Tags:** custom-database-connections, connections\
**Created:** [January 23, 2023, 8:51am UTC](https://community.auth0.com/t/how-to-set-user-rules-and-roles-with-mongodb-as-custom-database/98688 "2023-01-23T08:51:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![timo9132](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/timo9132/32/42903_2.png) [@timo9132](https://community.auth0.com/u/timo9132)\
**Post date:** [January 23, 2023, 8:51am UTC](https://community.auth0.com/t/how-to-set-user-rules-and-roles-with-mongodb-as-custom-database/98688/1 "2023-01-23T08:51:01Z")

</div>

Hi as title said, I am cracking head over how to do this. I am using auth0 for user login and mongodb as the custom database to store user credentials by following this guide, [Connecting Auth0 to MongoDB with Custom Databases](https://auth0.com/blog/connecting-auth0-to-mongodb/) . I have also used auth0 as a jwt service to authenticate my requests by following this guide. [https://www.mongodb.com/docs/atlas/app-services/authentication/custom-jwt/](https://www.mongodb.com/docs/atlas/app-services/authentication/custom-jwt/) . However, I am not sure where to go from here to set up roles and permissions.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [January 30, 2023, 10:16pm UTC](https://community.auth0.com/t/how-to-set-user-rules-and-roles-with-mongodb-as-custom-database/98688/3 "2023-01-30T22:16:04Z")

</div>

Hi @timo9132,

Welcome to the Auth0 Community!

Have you looked through this doc?

> **[Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/rbac)**
>
> Understand the concept of role-based access control and how it applies in Auth0.

---

<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 28, 2023, 1:22pm UTC](https://community.auth0.com/t/how-to-set-user-rules-and-roles-with-mongodb-as-custom-database/98688/4 "2023-03-28T13:22:16Z")

</div>

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