I'm beginner to yii2, I want to FOLLOW a suggermento Which way to create two users with different capabilities. Can you give me an example of how to create two types of users? Thanks so much
3 Answers
In yii2 for manage the proces for verifying that a user has enough permission to do somethingthere there are ACF and RBAC
ACF Access Control Filter is a simple authorization method implemented and is best used by applications that only need some simple access control.
RBAC Role-Based Access Control provides a powerful centralized access control yet simple to mnanage.
Yii implements a General Hierarchical RBAC, following the NIST RBAC model.
RBAC can be based on PHP files or directly on database table ..
you can find useful info in this guide http://www.yiiframework.com/doc-2.0/guide-security-authorization.html

- 131,976
- 10
- 91
- 107
Please folow yii2 starter kit for reference RBAC config. With feature RBAC with predefined guest, user, manager and administrator roles. Yii2 starter kit

- 595
- 5
- 18
You can use user roles and give specific permissions to each of roles

- 1
- 4
-
You mean by RBAC Rules? – Saba Oct 06 '16 at 15:28
-
you can not create two types of users? – Saba Oct 06 '16 at 15:28
-
Yes with RBAC you can also add optional fields to each role with pivot table – Jamshid Oct 06 '16 at 15:34