frontend controllers behaviors access

This commit is contained in:
akosse 2020-02-06 11:28:51 +03:00
parent 6d37a8ef18
commit f90a70811e
3 changed files with 21 additions and 5 deletions

View File

@ -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' => ['@'],
],
],
],
];
}

View File

@ -26,7 +26,7 @@ class UserCardController extends Controller
return [
'access' => [
'class' => AccessControl::className(),
'only' => ['index', 'update'],
//'only' => ['index', 'update'],
'rules' => [
[
'allow' => true,

View File

@ -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' => ['@'],
],
],
],
];
}