Commit 393a55ab255acf626a1dbb23573d3489322673d2
1 parent
68133386
TEst
Showing
1 changed file
with
15 additions
and
0 deletions
Show diff stats
backend/controllers/SiteController.php
@@ -29,6 +29,16 @@ class SiteController extends Controller | @@ -29,6 +29,16 @@ class SiteController extends Controller | ||
29 | 'rules' => [ | 29 | 'rules' => [ |
30 | [ | 30 | [ |
31 | 'allow' => true, | 31 | 'allow' => true, |
32 | + 'actions' => ['test'], | ||
33 | + 'matchCallback' => function($rule, $action) { | ||
34 | + return (Yii::$app->user->identity->id == 1); | ||
35 | + }, | ||
36 | + 'denyCallback' => function($rule, $action) { | ||
37 | + var_dump(Yii::$app->user->identity->id); | ||
38 | + }, | ||
39 | + ], | ||
40 | + [ | ||
41 | + 'allow' => true, | ||
32 | 'roles' => ['@'] | 42 | 'roles' => ['@'] |
33 | ], | 43 | ], |
34 | ], | 44 | ], |
@@ -144,5 +154,10 @@ class SiteController extends Controller | @@ -144,5 +154,10 @@ class SiteController extends Controller | ||
144 | return $this->redirect('[site/requests]'); | 154 | return $this->redirect('[site/requests]'); |
145 | } | 155 | } |
146 | } | 156 | } |
157 | + | ||
158 | + public function actionTest() | ||
159 | + { | ||
160 | + return $this->render('index'); | ||
161 | + } | ||
147 | 162 | ||
148 | } | 163 | } |