При использовании RBAC вываливается такая ошибка
An Error occurred while handling another error:
exception 'yii\web\ForbiddenHttpException' with message 'You are not allowed to perform this action.' in E:\serv\OpenServer\domains\advanced.lc\vendor\yiisoft\yii2\filters\AccessControl.php:151
Stack trace:
#0 E:\serv\OpenServer\domains\advanced.lc\vendor\yiisoft\yii2\filters\AccessControl.php(134): yii\filters\AccessControl->denyAccess(Object(yii\web\User))
#1 E:\serv\OpenServer\domains\advanced.lc\vendor\yiisoft\yii2\base\ActionFilter.php(71): yii\filters\AccessControl->beforeAction(Object(yii\web\ErrorAction))
#2 [internal function]: yii\base\ActionFilter->beforeFilter(Object(yii\base\ActionEvent))
#3 E:\serv\OpenServer\domains\advanced.lc\vendor\yiisoft\yii2\base\Component.php(541): call_user_func(Array, Object(yii\base\ActionEvent))
#4 E:\serv\OpenServer\domains\advanced.lc\vendor\yiisoft\yii2\base\Controller.php(263): yii\base\Component->trigger('beforeAction', Object(yii\base\ActionEvent))
#5 E:\serv\OpenServer\domains\advanced.lc\vendor\yiisoft\yii2\web\Controller.php(108): yii\base\Controller->beforeAction(Object(yii\web\ErrorAction))
#6 E:\serv\OpenServer\domains\advanced.lc\vendor\yiisoft\yii2\base\Controller.php(149): yii\web\Controller->beforeAction(Object(yii\web\ErrorAction))
#7 E:\serv\OpenServer\domains\advanced.lc\vendor\yiisoft\yii2\base\Module.php(455): yii\base\Controller->runAction('error', Array)
#8 E:\serv\OpenServer\domains\advanced.lc\vendor\yiisoft\yii2\web\ErrorHandler.php(85): yii\base\Module->runAction('site/error')
#9 E:\serv\OpenServer\domains\advanced.lc\vendor\yiisoft\yii2\base\ErrorHandler.php(109): yii\web\ErrorHandler->renderException(Object(yii\web\ForbiddenHttpException))
#10 [internal function]: yii\base\ErrorHandler->handleException(Object(yii\web\ForbiddenHttpException))
#11 {main}
Previous exception:
exception 'yii\web\ForbiddenHttpException' with message 'You are not allowed to perform this action.' in E:\serv\OpenServer\domains\advanced.lc\vendor\yiisoft\yii2\filters\AccessControl.php:151
Stack trace:
#0 E:\serv\OpenServer\domains\advanced.lc\vendor\yiisoft\yii2\filters\AccessControl.php(134): yii\filters\AccessControl->denyAccess(Object(yii\web\User))
#1 E:\serv\OpenServer\domains\advanced.lc\vendor\yiisoft\yii2\base\ActionFilter.php(71): yii\filters\AccessControl->beforeAction(Object(yii\base\InlineAction))
#2 [internal function]: yii\base\ActionFilter->beforeFilter(Object(yii\base\ActionEvent))
#3 E:\serv\OpenServer\domains\advanced.lc\vendor\yiisoft\yii2\base\Component.php(541): call_user_func(Array, Object(yii\base\ActionEvent))
#4 E:\serv\OpenServer\domains\advanced.lc\vendor\yiisoft\yii2\base\Controller.php(263): yii\base\Component->trigger('beforeAction', Object(yii\base\ActionEvent))
#5 E:\serv\OpenServer\domains\advanced.lc\vendor\yiisoft\yii2\web\Controller.php(108): yii\base\Controller->beforeAction(Object(yii\base\InlineAction))
#6 E:\serv\OpenServer\domains\advanced.lc\vendor\yiisoft\yii2\base\Controller.php(149): yii\web\Controller->beforeAction(Object(yii\base\InlineAction))
#7 E:\serv\OpenServer\domains\advanced.lc\vendor\yiisoft\yii2\base\Module.php(455): yii\base\Controller->runAction('', Array)
#8 E:\serv\OpenServer\domains\advanced.lc\vendor\yiisoft\yii2\web\Application.php(84): yii\base\Module->runAction('', Array)
#9 E:\serv\OpenServer\domains\advanced.lc\vendor\yiisoft\yii2\base\Application.php(375): yii\web\Application->handleRequest(Object(yii\web\Request))
#10 E:\serv\OpenServer\domains\advanced.lc\backend\web\index.php(18): yii\base\Application->run()
#11 {main}
вот контролер
<?php
namespace backend\controllers;
use Yii;
use yii\filters\AccessControl;
use yii\web\Controller;
use common\models\LoginForm;
use yii\filters\VerbFilter;
/**
* Site controller
*/
class SiteController extends Controller
{
/**
* @inheritdoc
*/
public function behaviors()
{
return [
'access' => [
'class' => AccessControl::className(),
'rules' => [
[
'allow' => true,
'roles' => ['admin'],
],
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'logout' => ['post'],
],
],
];
}
/**
* @inheritdoc
*/
public function actions()
{
return [
'error' => [
'class' => 'yii\web\ErrorAction',
],
];
}
public function actionIndex()
{
return $this->render('index');
}
public function actionLogin()
{
if (!\Yii::$app->user->isGuest) {
return $this->goHome();
}
$model = new LoginForm();
if ($model->load(Yii::$app->request->post()) && $model->login()) {
return $this->goBack();
} else {
return $this->render('login', [
'model' => $model,
]);
}
}
public function actionLogout()
{
Yii::$app->user->logout();
return $this->goHome();
}
}
common/config/bootstrap
<?php
Yii::setAlias('common', dirname(__DIR__));
Yii::setAlias('frontend', dirname(dirname(__DIR__)) . '/frontend');
Yii::setAlias('backend', dirname(dirname(__DIR__)) . '/backend');
Yii::setAlias('console', dirname(dirname(__DIR__)) . '/console');
из плагинов только adminLTE стоит