-
Install it via composer
albertborsos/yii2-user
-
Run sql script from the
tests/_data
folder (yii migrate will available) (delete my user) -
add these snippet to your
config/main.php
file
'components' => [
...
'authManager' => [
'class' => 'yii\rbac\DbManager',
'itemTable' => 'auth_item',
'itemChildTable' => 'auth_item_child',
'assignmentTable' => 'auth_assignment',
'ruleTable' => 'auth_rule',
'defaultRoles' => ['guest'],
],
'user' => [
'identityClass' => 'albertborsos\yii2user\models\Users',
'enableAutoLogin' => false,
'loginUrl' => ['users/login'],
],
...
]
- register yourself than modify your right to admin in
auth_assignment
table