1. Go to this page and download the library: Download justcoded/yii2-rbac library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
'container' => [
'definitions' => [
// you can create your own GrivView to customize all options for main roles and permissions lists.
'justcoded\yii2\rbac\widgets\RbacGridView' => [
'class' => \app\modules\admin\widgets\RbacGridView::class,
],
// this will replace bootstrap3 ActiveForm with bootstrap4 ActiveForm.
'justcoded\yii2\rbac\widgets\RbacActiveForm' => [
'class' => \yii\bootstrap4\ActiveForm::class,
],
],
],
public function actions()
{
return [
'routeAccess' => [
'class' => 'justcoded\yii2\rbac\filters\RouteAccessControl',
],
];
}