This document will guide you through the process of installing Yii2-rbac using composer. Installation is a quick and easy four-step process.
NOTE: Before we start make sure that you have properly configured db application component.
NOTE: Please make sure that you don't have
authManager
component configured. It will be configured automatically during installation.
Download extension using composer:
$ composer require dektrium/yii2-rbac:1.0.0-alpha@dev
Add rbac module to web application config file as follows:
...
'modules' => [
...
'rbac' => 'dektrium\rbac\RbacWebModule',
...
],
...
Add rbac module to console application config file as follows:
...
'modules' => [
...
'rbac' => 'dektrium\rbac\RbacConsoleModule',
...
],
...
After you downloaded and configured Yii2-rbac, the last thing you need to do is updating your database schema by applying the migration:
$ php yii migrate/up --migrationPath=@yii/rbac/migrations