问题
I have installed yii2 mongodb extension, I am able to create mongodb collection, model etc.
I have also installed https://github.com/imanilchaudhari/yii2-mongodb-admin, but there are no docs, how to configure the same. but it contains some hints, which I am not able to make out like
GUI manager for RBAC.
Use [[\yii\base\Module::$controllerMap]] to change property of controller. To change listed menu, use property [[$menus]].
'layout' => 'left-menu', // default to null mean use application layout.
'controllerMap' => [
'assignment' => [
'class' => 'imanilchaudhari\mongodb\admin\controllers\AssignmentController',
'userClassName' => 'app\models\User',
'idField' => 'id'
]
],
'menus' => [
'assignment' => [
'label' => 'Grand Access' // change label
],
'route' => null, // disable menu
],
I also tried to add in components section of config/web.php
like
'authManager' => [
'class' => 'yii\mongodb\rbac\MongoDbManager ',
'defaultRoles' => ['guest'],
],
and just to check I added in site/about
controller like:
public function actionAbout()
{
if(Yii::$app->user->can('view'))
{
return $this->render('about');
}
}
and I am getting the error like:
Failed to instantiate component or class "yii\mongodb\rbac\MongoDbManager ".
anyone who has configured this module or otherwise help me implement it.
来源:https://stackoverflow.com/questions/59897322/yii2-mogodb-rbac-configuration