# User Roles vs Org Roles

**URL:** <https://community.auth0.com/t/user-roles-vs-org-roles/86372>\
**Category:** Get Help\
**Tags:** auth0\
**Created:** [July 4, 2022, 1:30pm UTC](https://community.auth0.com/t/user-roles-vs-org-roles/86372 "2022-07-04T13:30:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![roboncode](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/roboncode/32/38547_2.png) [@roboncode](https://community.auth0.com/u/roboncode)\
**Post date:** [July 4, 2022, 1:30pm UTC](https://community.auth0.com/t/user-roles-vs-org-roles/86372/1 "2022-07-04T13:30:42Z")

</div>

If I assign a user a role of “Support” and that user logs into an organization, will they have the “Support” permissions, or do I also need to assign that user the role of “Support” in the organization?

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [July 8, 2022, 10:23pm UTC](https://community.auth0.com/t/user-roles-vs-org-roles/86372/3 "2022-07-08T22:23:38Z")

</div>

Hello @roboncode welcome to the community!

You’ll need to assign the role from within the Organization itself - For example, if you assign the a role directly, use an Action (below) to add it to a token, but the user authorizes through an Organization the role will not be reflected. It will however be reflected in the token if the role is instead assigned to the user from within the Organization settings.

```auto
exports.onExecutePostLogin = async (event, api) => {
  const namespace = 'https://my-app.example.com';
  if (event.authorization) {
    api.idToken.setCustomClaim(`${namespace}/roles`, event.authorization.roles);
    api.accessToken.setCustomClaim(`${namespace}/roles`, event.authorization.roles);
    
  }
}

```

Hope this helps!

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [July 23, 2022, 10:24pm UTC](https://community.auth0.com/t/user-roles-vs-org-roles/86372/4 "2022-07-23T22:24:23Z")

</div>

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