# Implement users and roles in cakephp 4.2

**URL:** <https://discourse.cakephp.org/t/implement-users-and-roles-in-cakephp-4-2/10264>\
**Category:** Need Help\
**Created:** [April 2, 2022, 8:06pm UTC](https://discourse.cakephp.org/t/implement-users-and-roles-in-cakephp-4-2/10264 "2022-04-02T20:06:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdeanquin](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/mdeanquin/32/1802_2.png) [@mdeanquin](https://discourse.cakephp.org/u/mdeanquin)\
**Post date:** [April 2, 2022, 8:06pm UTC](https://discourse.cakephp.org/t/implement-users-and-roles-in-cakephp-4-2/10264/1 "2022-04-02T20:06:21Z")

</div>

Is there a way to implement roles to the users? What I need is to show or not the different actions a user can execute in the grid of the index action and in the view action of the related tables.

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [April 3, 2022, 12:05pm UTC](https://discourse.cakephp.org/t/implement-users-and-roles-in-cakephp-4-2/10264/2 "2022-04-03T12:05:14Z")

</div>

You can check how CakeDC implements their RBAC

> **[GitHub - CakeDC/auth: Auth objects for CakePHP](https://github.com/CakeDC/auth)**
>
> Auth objects for CakePHP. Contribute to CakeDC/auth development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![mdeanquin](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/mdeanquin/32/1802_2.png) [@mdeanquin](https://discourse.cakephp.org/u/mdeanquin)\
**Post date:** [April 3, 2022, 1:42pm UTC](https://discourse.cakephp.org/t/implement-users-and-roles-in-cakephp-4-2/10264/3 "2022-04-03T13:42:55Z")

</div>

Is there a command to install this plugin in console like the authentication plugin, or I have to add it manually?

---

<div class="post-metadata">

**Author:** ![javi](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/javi/32/2447_2.png) [@javi](https://discourse.cakephp.org/u/javi)\
**Post date:** [April 12, 2022, 2:56pm UTC](https://discourse.cakephp.org/t/implement-users-and-roles-in-cakephp-4-2/10264/4 "2022-04-12T14:56:21Z")

</div>

For implementing roles for users I recommend the official [authorization plugin](https://book.cakephp.org/authorization/2/en/index.html) It has a good and understandable documentation. You can install this plugin with the composer way ‘composer require cakephp/authorization:^2.0’
