mdmsoft / yii2-admin

Auth manager for Yii2 (RBAC Manager)
GNU General Public License v3.0
1.16k stars 574 forks source link

Document (better) how to use this app in advanced template #78

Closed realtebo closed 7 years ago

realtebo commented 9 years ago

When running

yii migrate --migrationPath=@yii/rbac/migrations

I got this alert

Exception 'yii\base\InvalidConfigException' with message 'You should configure "authManager" component to use database before executing this migration.'

I added all the config into main.php of adavanced.

But to make migrations working, I need to move 'authManager' config into the main of common config

Thank you for your work

russellfeeed commented 9 years ago

Confirmed - this works when working with the advanced template.

Just add

       // see https://github.com/mdmsoft/yii2-admin/issues/78
        'authManager' => [
              'class' => 'yii\rbac\DbManager', // or use 'yii\rbac\PhpManager'
        ],

to common\config\main-local.php

ghost commented 9 years ago

Hi guys, I am using basic template but I still got this error although I added 'authManager' => [ 'class' => 'yii\rbac\DbManager', // or use 'yii\rbac\PhpManager' ], to web.php file in config directory

Thank in advance

twg-group commented 9 years ago

you need add code to the console config...

Zarey commented 8 years ago

russellfeeed, Thanks