Skip to content

artkost/yii2-rbac

Repository files navigation

Yii2 RBAC

Under Heavy Development

Usage

Configure your authManager

[
    'class' => 'yii\rbac\DbManager',
    'itemTable' => '{{%rbac_item}}',
    'itemChildTable' => '{{%rbac_item_child}}',
    'assignmentTable' => '{{%rbac_assignment}}',
    'ruleTable' => '{{%rbac_rule}}',
    'defaultRoles' => ['guest'],
    'cache' => 'cache'
]

and user component

[
  'class' => 'app\modules\rbac\components\User',
]

Run Migrate command php yii migrate --migrationPath=@app/modules/rbac/migrations

Then run module command php yii rbac/manager/refresh' That command adds rules from rules.php` to database

Releases

No releases published

Packages

No packages published

Languages