# 2 diretores for validate

**URL:** <https://community.auth0.com/t/2-diretores-for-validate/41357>\
**Category:** JWT.io\
**Tags:** jwt, php\
**Created:** [April 19, 2020, 1:50pm UTC](https://community.auth0.com/t/2-diretores-for-validate/41357 "2020-04-19T13:50:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![carcleo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/carcleo/32/13315_2.png) [@carcleo](https://community.auth0.com/u/carcleo)\
**Post date:** [April 19, 2020, 1:50pm UTC](https://community.auth0.com/t/2-diretores-for-validate/41357/1 "2020-04-19T13:50:03Z")

</div>

I have the follows folders in my project:

> //here are the site/shopping administration  
> site/admin  
> site/admin/login  
> //here are the place of clientes of shopping  
> site/shopping  
> site/dhopping/login

if the client loggin sucessfull, then he be able to of access, using JWT, to **site/admin** too?

Exists a way of to protect this as in $\_SESSION[“admin”] and $\_SESSION[“cliente”]?

---

<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:** [April 21, 2020, 9:05pm UTC](https://community.auth0.com/t/2-diretores-for-validate/41357/3 "2020-04-21T21:05:53Z")

</div>

Hi @carcleo,

Welcome to the Community!

You can add roles to your users, and then protect the routes based on what roles the user has. You will need to set up role based access control:

> **[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.

Then you will need to add the roles to the token:

> **[Sample Use Cases: Rules with Authorization](https://auth0.com/docs/manage-users/access-control/sample-use-cases-rules-with-authorization)**
>
> Learn how to use rules with roles-based access control (RBAC). For use with our Authorization Core feature set.

Hope this helps!  
Dan

---

<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:** [July 13, 2020, 10:18pm UTC](https://community.auth0.com/t/2-diretores-for-validate/41357/4 "2020-07-13T22:18:38Z")

</div>

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