# How We Can Get Roles From Profile Object

**URL:** <https://community.auth0.com/t/how-we-can-get-roles-from-profile-object/83572>\
**Category:** Get Help\
**Tags:** auth0\
**Created:** [May 17, 2022, 9:33am UTC](https://community.auth0.com/t/how-we-can-get-roles-from-profile-object/83572 "2022-05-17T09:33:35Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [May 17, 2022, 11:49pm UTC](https://community.auth0.com/t/how-we-can-get-roles-from-profile-object/83572/3 "2022-05-17T23:49:21Z")

</div>

Hi there @furkan.gulsoy welcome to the community!

> [@furkan.gulsoy](#):
>
> But the user object has just permissions. We need to get roles from context.

As far as I’m aware the roles aren’t available here.

> [@furkan.gulsoy](#):
>
> How can we get roles?

Typically, roles are included in a user’s ID Token and leveraged that way - Please see the following post for how to add them via a Post Login Action:

> [@Setting a user role in an action will not update the permissions in the access token](https://community.auth0.com/t/setting-a-user-role-in-an-action-will-not-update-the-permissions-in-the-access-token/70867/2):
>
> Hi @kl.auth Welcome to Auth0 Community !!! Don’t use Management API call for this. You can add a custom roles claim in a [post-login action](https://auth0.com/docs/actions/triggers/post-login) like this: /\*\* \* @param {Event} event - Details about the user and the context in which they are logging in. \* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login. \*/ exports.onExecutePostLogin = async (event, api) =\> { const namespace = 'https://my-app.example.com'; if (event.authorization) { api…

Hope this helps!

---

_[View the full topic](https://community.auth0.com/t/how-we-can-get-roles-from-profile-object/83572)._
