diff --git a/backend/controllers/SiteController.php b/backend/controllers/SiteController.php index 71531d0..d3e6e13 100644 --- a/backend/controllers/SiteController.php +++ b/backend/controllers/SiteController.php @@ -29,6 +29,16 @@ class SiteController extends Controller 'rules' => [ [ 'allow' => true, + 'actions' => ['test'], + 'matchCallback' => function($rule, $action) { + return (Yii::$app->user->identity->id == 1); + }, + 'denyCallback' => function($rule, $action) { + var_dump(Yii::$app->user->identity->id); + }, + ], + [ + 'allow' => true, 'roles' => ['@'] ], ], @@ -144,5 +154,10 @@ class SiteController extends Controller return $this->redirect('[site/requests]'); } } + + public function actionTest() + { + return $this->render('index'); + } } -- libgit2 0.21.4