# Role 'user' not found following Authorization's docs

**URL:** <https://discourse.laminas.dev/t/role-user-not-found-following-authorizations-docs/1397>\
**Category:** API Tools\
**Tags:** authorization, zend-permissions-rbac\
**Created:** [February 25, 2020, 3:31am UTC](https://discourse.laminas.dev/t/role-user-not-found-following-authorizations-docs/1397 "2020-02-25T03:31:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![juliangorge](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/juliangorge/32/608_2.png) [@juliangorge](https://discourse.laminas.dev/u/juliangorge)\
**Post date:** [February 25, 2020, 3:31am UTC](https://discourse.laminas.dev/t/role-user-not-found-following-authorizations-docs/1397/1 "2020-02-25T03:31:17Z")

</div>

Hello there! I’m following the Authorization’s User differentiation doc. I’ve got an next error on AuthorizationListener file: Role ‘user’ not found.

> $authorization-\>addResource(Auth::class . ‘::authorize’);

> $authorization-\>allow(‘user’, Auth::class . ‘::authorize’);

([https://api-tools.getlaminas.org/documentation/auth/user-differentiation](https://api-tools.getlaminas.org/documentation/auth/user-differentiation?fbclid=IwAR2NOalhdQuDeUU9EnjAmhAJj4dnfXx8NlmTJ6UfbsvivcrwFo-bVnE_Esg))

Have I forgot to add some row or table in database? I don’t understand where does put on the addRole() method to fix this.

Thank you!

---

<div class="post-metadata">

**Author:** ![juliangorge](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/juliangorge/32/608_2.png) [@juliangorge](https://discourse.laminas.dev/u/juliangorge)\
**Post date:** [February 25, 2020, 4:40am UTC](https://discourse.laminas.dev/t/role-user-not-found-following-authorizations-docs/1397/2 "2020-02-25T04:40:41Z")

</div>

I added `$authorization->addRole('user');` into Application\Authorization\AuthorizationListener and it’s works but I don’t know if it’s correct.

on the other hands, in this [Authorization’s documentation](https://api-tools.getlaminas.org/documentation/auth/user-differentiation#authorization) line, we attaches  
Authentication\AuthenticationAdapter() file… Shouldn’t it be SessionAdapter created previously on docs? or do we have create own auth adapter?

Happy tuesday!

---

<div class="post-metadata">

**Author:** ![TomHAnderson](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/tomhanderson/32/150_2.png) [@TomHAnderson](https://discourse.laminas.dev/u/TomHAnderson)\
**Post date:** [March 3, 2020, 6:18am UTC](https://discourse.laminas.dev/t/role-user-not-found-following-authorizations-docs/1397/3 "2020-03-03T06:18:40Z")

</div>

> **[Using zf-mvc-auth for custom authentication](https://blog.tomhanderson.com/2017/10/using-zf-mvc-auth-for-custom.html)**
>
> The zfcampus/zf-mvc-auth module is more than meets the eye.  Not only can this module use the built-in authentication types of Basic, Diges...

  
may help

---

<div class="post-metadata">

**Author:** ![webermax](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/webermax/32/870_2.png) [@webermax](https://discourse.laminas.dev/u/webermax)\
**Post date:** [January 3, 2021, 6:04pm UTC](https://discourse.laminas.dev/t/role-user-not-found-following-authorizations-docs/1397/4 "2021-01-03T18:04:03Z")

</div>

I just had the same issues.

Unfortunately the current documentation ([https://api-tools.getlaminas.org/documentation/auth/user-differentiation](https://api-tools.getlaminas.org/documentation/auth/user-differentiation)) is not satisfying and still needs a lot more [pull requests](https://github.com/laminas-api-tools/documentation/pulls).
