PHP code example of myzero1 / yii2-rbacp
1. Go to this page and download the library: Download myzero1/yii2-rbacp 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/ */
myzero1 / yii2-rbacp example snippets
return [
......
'bootstrap' => [
......
'rbacp' => [
'class' => '\myzero1\rbacp\Bootstrap', // for rbacp function
'params' => [
'urlManager' => [
'rules' => [
// 'rate/area/index' => 'rate/jf-core-area/index',
],
],
'rbacp' => [
'model' => 'rbac',//everyone,logined,rbac,rbacp
'develop' => 1,//The id of the developer
'rbacpTester' => 2,//The id of the tester of rbacp
'denyCallbackUri' => '/rbacp/default/rbacp403',
'loginUri' => '/site/login',
// 'beforeCheckActionFunc' => function(){
// $url = \yii\helpers\Url::to(['/site/error403','isLocked'=>1], true);
// $uri = '/site/error403';
// if ( strpos($_SERVER['REQUEST_URI'], $uri) === false) {
// if (!\Yii::$app->user->isGuest && Yii::$app->user->identity->isLocked) {
// \Yii::$app
// ->getResponse()
// ->redirect($url)
// ->send();
// }
// }
// },
// 'afterCheckActionFunc' => function(){},
'accessRules' => [
'excludeUri' => [
'/rbacp/default/index',
'/rbacp/default/rbacp403',
'/site/captcha',
'/site/login-ajax',
],
'developUri' => [
'/rbacp/default/migrate-up',
'/rbacp/default/migrate-down',
],
'loginedExcludeUri' => [
'/site/logout',
'/site/index',
'/adminlteiframe/layout',
],
],
],
],
],
......
],
'modules' => [
......
'rbacp' => [ // you should seting it,when you are developing.
'class' => '\myzero1\rbacp\Module',
'theme' => 'adminlteiframe', // adminlteiframe, adminlte
],
......
],
......
];
php composer.phar