Yii2 And Rbac


I can not understand how use RBAC in Yii2.

I have 2 user type: admin and user. Type of user i store in DB.


  1. create roles and use this role in controller.

  2. check user role in code

  3. Assign role with user after auth

Please, do not write links as answer.


The Online Docs are outdated and cannot build offline from latest.

duh! :unsure:

Did you do already the Authentification part ?

Use this link for the definitive guide for Yii2 (with navigation and search ability).