Yii Framework Forum: Advanced doubts administration rules - mdmsoft/yii2-admin - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Advanced doubts administration rules - mdmsoft/yii2-admin Rate Topic: -----

#1 User is offline   wardog 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 17-April 15

Posted 18 April 2015 - 11:24 AM

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/*',
        ]
    ],
];

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users