xj/yii2-rbac-module

yii2-rbac-module

Installs: 37

Dependents: 0

Watchers: 1

Forks: 1

Language: PHP

1.0.1 2015-08-26 08:13 UTC

README

composer.json

"xj/yii2-rbac-module": "~1.0.0",

config

'components' => [
    'authManager' => [
        'class' => 'yii\rbac\PhpManager',
        'itemFile' => '@common/rbac/items.php',
        'assignmentFile' => '@common/rbac/assignments.php',
        'ruleFile' => '@common/rbac/rules.php',
    ],
],
IP & Roles
'modules' => [
    'rbac' => [
        'class' => 'xj\rbac\Module',
        'userIdField' => 'id',
        'userNameField' => 'username',
        'userTableModelName' => '\common\models\Admin',
        'allowedIPs' => ['127.0.0.1', '::1'],
        'roles' => ['admin'],
    ]
],
IP Only
'modules' => [
    'rbac' => [
        'class' => 'xj\rbac\Module',
        'userIdField' => 'id',
        'userNameField' => 'username',
        'userTableModelName' => '\common\models\Admin',
        'layout' => 'main', //optional
        'allowedIPs' => ['127.0.0.1', '::1'],
        'roles' => ['@', '?'],
    ]
],
Role Only
'modules' => [
    'rbac' => [
        'class' => 'xj\rbac\Module',
        'userIdField' => 'id',
        'userNameField' => 'username',
        'userTableModelName' => '\common\models\Admin',
        'allowedIPs' => ['*'],
        'roles' => ['admin'],
    ]
],

access

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