# How to model the use case where roles are specific to a project and not at an application level

**URL:** <https://community.auth0.com/t/how-to-model-the-use-case-where-roles-are-specific-to-a-project-and-not-at-an-application-level/54919>\
**Category:** Get Help\
**Created:** [December 16, 2020, 5:25am UTC](https://community.auth0.com/t/how-to-model-the-use-case-where-roles-are-specific-to-a-project-and-not-at-an-application-level/54919 "2020-12-16T05:25:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![santhosh.sadanandan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/santhosh.sadanandan/32/12846_2.png) [@santhosh.sadanandan](https://community.auth0.com/u/santhosh.sadanandan)\
**Post date:** [December 16, 2020, 5:25am UTC](https://community.auth0.com/t/how-to-model-the-use-case-where-roles-are-specific-to-a-project-and-not-at-an-application-level/54919/1 "2020-12-16T05:25:31Z")

</div>

We have a use case where the application has projects and users are added to different roles in various projects. For example, Mike is a registered user. He is Project Manager in one project and a Director in another. I want to be able to authorise his actions in the his projects based on the role he holds in it.

How do I model this in Auth0?

---

<div class="post-metadata">

**Author:** ![markd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/markd/32/38919_2.png) [@markd](https://community.auth0.com/u/markd)\
**Post date:** [December 16, 2020, 5:54am UTC](https://community.auth0.com/t/how-to-model-the-use-case-where-roles-are-specific-to-a-project-and-not-at-an-application-level/54919/2 "2020-12-16T05:54:24Z")

</div>

Hello @santhosh.sadanandan,

Welcome to the Auth0 Community! Depending on your application architecture you may be able to leverage Auth0’s [core authorization](https://auth0.com/docs/authorization/how-to-use-auth0s-core-authorization-feature-set) feature, but I suspect you may need to build a DIY solution by storing role data in [app\_metadata](https://auth0.com/docs/users/metadata). Off the cuff:

```auto
"app_metadata": {
  "entitlements": {
    "project_1": {
      "role": "Project Manager"
    },
    "project_2": {
      "role": "Director"
    }
  }
}

```

Then use an [Auth0 Rule](https://auth0.com/docs/rules) to include entitlements data in the user’s ID and / or access tokens.

Or you could potentially use both … use core RBAC to organize scopes / entitlements and user metadata to store project access data. This might work if, for example, all Project Manager have the same entitlements, but restricted by project.

---

<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:** [December 31, 2020, 5:54am UTC](https://community.auth0.com/t/how-to-model-the-use-case-where-roles-are-specific-to-a-project-and-not-at-an-application-level/54919/3 "2020-12-31T05:54:25Z")

</div>

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