Hello I have a question a little advanced:
Using the advanced template and extension yii2 mdm/yii2-admin, this extension I install from file in the common folder and it works.
But I have the following tables:
-User (In this table extends tables: employee and client)
-Manager
I require:
In the BackEnd:
The administrator administer roles and permissions from junior-administrator, moderator, users, visitors.
In the FrontEnd:
The junior-administrator administer only roles and permissions from moderator, users, visitors.
*Administrators will be stored in the Table "Manager"
*Los other users in Table "User"
What will be the most optimal and fast way to achieve this?
My current configuration:
In common/config/main-local.php:
return [
'aliases' => [
'@mdm/admin' => '@common/admin',
],
'components' => [
'db' => [
...],
'mailer' => [
...],
'authManager' => [
'class' => 'yii\rbac\DbManager',
]
],
];
In frondend/config/main-local.php and backend/config/main-local:
<?php
$config = [
'modules' => [
'admin' => [
'class' => 'mdm\admin\Module',
'layout' => null,
'controllerMap' => [
'assignment' => [
'class' => 'mdm\admin\controllers\AssignmentController',
'userClassName' => 'common\models\User',
'idField' => 'id'
]
],
'menus' => [
'assignment' => [
'label' => 'Grand Access'
],
'route' => null,
],
]
],
'components' => [
'request' => [
...],
'authManager' => [
'class' => 'yii\rbac\DbManager', // or use 'yii\rbac\DbManager'
]
],
'as access' => [
'class' => 'mdm\admin\components\AccessControl',
'allowActions' => [
'admin/*',
]
],
];