mdmsoft / yii2-admin

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

Call to a member function getRoles() on null #401

Open alreadyshow opened 6 years ago

alreadyshow commented 6 years ago

"mdmsoft/yii2-admin": "3.0"

/**

can't get the function? is that a bug?

alreadyshow commented 6 years ago

i found it,it's config error. authManager should write at backend/config/main.php.

attybean commented 5 years ago

I have the same problem. Can you elaborate on what the error is and how to come around it?` @alreadyshow

yogi9096 commented 4 years ago

i had same error , i had my authManager config in console/config/main.php then i added in backend , now its working file. you need to add this both console config - to run migration and in backend to run this extension

/opt/lampp/htdocs/yii2test/backend/config/main.php 'components' => [ 'authManager' => [ 'class' => 'yii\rbac\DbManager', // uncomment if you want to cache RBAC items hierarchy // 'cache' => 'cache', ], }