r2am9d/yii2-rbac-rule

Yii2 RBAC Rule Generator Extension for the Yii Framework

dev-master 2021-04-23 04:00 UTC

This package is auto-updated.

Last update: 2024-04-23 10:32:29 UTC


README

993323

Yii2 RBAC Rule Generator Extension


An extension for generataring rule classes via gii.

Installation

The preferred way to install this extension is through composer:

Either run

php composer.phar require --prefer-dist r2am9d/yii2-rbac-rule

or add

"r2am9d/yii2-rbac-rule": "*"

to the require-dev section of your composer.json file.

Usage

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

return [
    'bootstrap' => ['gii'],
    'modules' => [
        'gii' => [
            'class' => 'yii\gii\Module',
            'generators' => [
                'rule' => [
                    'class' => 'r2am9d\rule\gii\Generator'
                ]
            ]
        ],
    ],
];

You can then access the generator through the following URL:

http://localhost/path/to/index?r=gii/rule

or if you have enabled pretty URLs, you may use the following URL:

http://localhost/path/to/index/gii/rule