yii2-admin RBAC Manager for Yii 2

  1. Requirements
  2. Installation
  3. Usage
  4. Resources

Yii 2 Extension to manage Role Base Access Control.

Requirements

Yii 2.0 or above

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require mdmsoft/yii2-admin "*"

or add ~~~ "mdmsoft/yii2-admin": "*" ~~~ to the require section of your composer.json file.

Usage

Once the extension is installed, simply modify your application configuration as follows:

return [
    'modules' => [
        'admin' => [
            'class' => 'mdm\admin\Module',
        ]
        ...
    ],
    ...
    'components' => [
        ....
        'authManager' => [
            'class' => 'yii\rbac\PhpManager', // or use 'yii\rbac\DbManager'
        ]
    ],
    'as access' => [
        'class' => 'mdm\admin\components\AccessControl',
        'allowActions' => [
            'admin/*', // add or remove allowed actions to this list
        ]
    ,
];

See Yii RBAC for more detail. You can then access Auth manager through the following URL: ~~~ http://localhost/path/to/index.php?r=admin ~~~

Resources

Fork me on github

3 0
27 followers
0 downloads
Yii Version: 2.0
License: BSD-2-Clause
Category: Auth
Developed by: Misbahul D Munir
Created on: May 28, 2014
Last updated: 3 years ago

Related Extensions