From f90a70811e3d853b3e5bdd7a9d1e6f7bca70b889 Mon Sep 17 00:00:00 2001 From: akosse Date: Thu, 6 Feb 2020 11:28:51 +0300 Subject: [PATCH] frontend controllers behaviors access --- .../modules/access/controllers/AccessController.php | 11 ++++++++++- .../modules/card/controllers/UserCardController.php | 2 +- .../reports/controllers/ReportsController.php | 13 ++++++++++--- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/frontend/modules/access/controllers/AccessController.php b/frontend/modules/access/controllers/AccessController.php index d6e4c4a..c58df16 100644 --- a/frontend/modules/access/controllers/AccessController.php +++ b/frontend/modules/access/controllers/AccessController.php @@ -4,8 +4,8 @@ namespace frontend\modules\access\controllers; use Yii; use common\models\Accesses; -use frontend\modules\access\models\AccessSearch; use yii\data\ActiveDataProvider; +use yii\filters\AccessControl; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; @@ -27,6 +27,15 @@ class AccessController extends Controller 'delete' => ['POST'], ], ], + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], ]; } diff --git a/frontend/modules/card/controllers/UserCardController.php b/frontend/modules/card/controllers/UserCardController.php index 3a81c7e..ec66944 100755 --- a/frontend/modules/card/controllers/UserCardController.php +++ b/frontend/modules/card/controllers/UserCardController.php @@ -26,7 +26,7 @@ class UserCardController extends Controller return [ 'access' => [ 'class' => AccessControl::className(), - 'only' => ['index', 'update'], + //'only' => ['index', 'update'], 'rules' => [ [ 'allow' => true, diff --git a/frontend/modules/reports/controllers/ReportsController.php b/frontend/modules/reports/controllers/ReportsController.php index f6fe4e7..0ba2de3 100644 --- a/frontend/modules/reports/controllers/ReportsController.php +++ b/frontend/modules/reports/controllers/ReportsController.php @@ -2,12 +2,10 @@ namespace frontend\modules\reports\controllers; -use common\classes\Debug; -use common\models\Accesses; use Yii; use common\models\Reports; use frontend\modules\reports\models\ReportsSearch; -use yii\data\ActiveDataProvider; +use yii\filters\AccessControl; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; @@ -29,6 +27,15 @@ class ReportsController extends Controller 'delete' => ['POST'], ], ], + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], ]; }