Skip to content

Commit 80493fc

Browse files
committed
access filter
1 parent 1e3d868 commit 80493fc

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

AdminDefaultController.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use yii\data\ActiveDataProvider;
66
use yii\db\ActiveRecord;
77
use yii\filters\VerbFilter;
8-
use yii\web\Controller;
8+
use yii\helpers\ArrayHelper;
99
use yii\web\Cookie;
1010
use yii\web\NotFoundHttpException;
1111
use Yii;
@@ -47,14 +47,14 @@ class AdminDefaultController extends BaseController
4747

4848
public function behaviors()
4949
{
50-
return [
50+
return ArrayHelper::merge(parent::behaviors(),[
5151
'verbs' => [
5252
'class' => VerbFilter::className(),
5353
'actions' => [
5454
'delete' => ['post'],
5555
],
5656
],
57-
];
57+
]);
5858
}
5959

6060
/**

BaseController.php

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
<?php
22

33
namespace webvimark\components;
4-
use webvimark\modules\UserManagement\components\AccessController;
4+
use webvimark\modules\UserManagement\components\GhostAccessControl;
55
use Yii;
6+
use yii\web\Controller;
67

7-
class BaseController extends AccessController
8+
class BaseController extends Controller
89
{
10+
/**
11+
* @return array
12+
*/
13+
public function behaviors()
14+
{
15+
return [
16+
'ghost-access'=> [
17+
'class' => GhostAccessControl::className(),
18+
],
19+
];
20+
}
21+
922
/**
1023
* Render ajax or usual depends on request
1124
*

0 commit comments

Comments
 (0)