# Assigning user roles with an associated project id

**URL:** <https://community.auth0.com/t/assigning-user-roles-with-an-associated-project-id/51217>\
**Category:** Get Help\
**Tags:** app\_metadata, roles, auth0\
**Created:** [October 8, 2020, 6:21am UTC](https://community.auth0.com/t/assigning-user-roles-with-an-associated-project-id/51217 "2020-10-08T06:21:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![izzopod](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/izzopod/32/24780_2.png) [@izzopod](https://community.auth0.com/u/izzopod)\
**Post date:** [October 8, 2020, 6:21am UTC](https://community.auth0.com/t/assigning-user-roles-with-an-associated-project-id/51217/1 "2020-10-08T06:21:23Z")

</div>

Hello,

I’m trying to implement authorization based on a combination of user roles and projects. If a user has a specific role for a project, then it will be given certain permissions only within the project. **I want to be able to add multiple user roles attached to multiple projects for one user.**

For example:

#### projects

_id and data would be pulled from personal database_

- project 1
- project 2

#### roles

- admin: doesn’t need project assigned, manages multiple projects
- team lead: can access across an entire project
- team member: can only access specific data within a project

One user can be a team lead for project 1, and a team member for project 2.

* * *

#### potential solutions

I’ve seen solutions involving groups, but because the nature of projects (want it to be easy to CRUD projects for admins), using groups seems too permanent.

I also considered a solution where I would store role and project combinations into a user’s app metadata:  
userRoles: [  
{  
role: ‘team lead’,  
project: ‘project 1’  
},  
{  
role:‘team member’,  
project: ‘project 2’  
}  
]

Though I am not sure if this is really a viable option. Does anyone have any other ideas as to how I can go about this?

---

<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:** [October 12, 2020, 9:57pm UTC](https://community.auth0.com/t/assigning-user-roles-with-an-associated-project-id/51217/3 "2020-10-12T21:57:21Z")

</div>

Hi @izzopod,

Welcome to the Community!

For some of our extensions, we name the extension in the role.

Like this:

- Extension A - Admin
- Extension B - User
- Extension C - Admin  
etc…

This is all using the RBAC Core feature set.

> **[Configure Core Authorization Features for Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/configure-core-rbac)**
>
> Learn how to configure Auth0 Core Authorization features for role-based access control (RBAC) of your APIs.

---

<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:** [October 27, 2020, 9:57pm UTC](https://community.auth0.com/t/assigning-user-roles-with-an-associated-project-id/51217/4 "2020-10-27T21:57:25Z")

</div>

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