xj/yii2-rbac-module

yii2-rbac-module

Installs: 25

Dependents: 0

Watches: 1

Forks: 1

Language: PHP

1.0.0 2014-07-04 02:40 UTC

README

composer.json

"require": {
    "yii2-rbac-module": "*"
},

config

 $config['components']['authManager'] => [
    'class' => 'yii\rbac\PhpManager',
    'itemFile' => '@common/rbac/items.php',
    'assignmentFile' => '@common/rbac/assignments.php',
    'ruleFile' => '@common/rbac/rules.php',
];

$config['modules']['rbac'] = [
    'class' => 'xj\rbac\Module',
    'userIdField' => 'uid',
    'userNameField' => 'username',
    'userTableModelName' => '\common\models\Members',
    'allowedIPs' => ['127.0.0.1', '::1'], //dump from yii\gii
    'layout' => 'main',  //main-parent=use app main | main=rbac layout
];

access

http://project/index.php?r=rbac