Role 'user' not found following Authorization's docs

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)

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!

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 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!


may help