File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change 33namespace yii2mod \comments \controllers ;
44
55use Yii ;
6- use yii \filters \AccessControl ;
76use yii \filters \VerbFilter ;
87use yii \web \Controller ;
98use yii \web \NotFoundHttpException ;
@@ -34,6 +33,19 @@ class ManageController extends Controller
3433 */
3534 public $ searchClass = 'yii2mod\comments\models\search\CommentSearch ' ;
3635
36+ /**
37+ * @var array access control config
38+ */
39+ public $ accessControlConfig = [
40+ 'class ' => 'yii\filters\AccessControl ' ,
41+ 'rules ' => [
42+ [
43+ 'allow ' => true ,
44+ 'roles ' => ['admin ' ],
45+ ],
46+ ],
47+ ];
48+
3749 /**
3850 * @inheritdoc
3951 */
@@ -48,15 +60,7 @@ public function behaviors()
4860 'delete ' => ['post ' ],
4961 ],
5062 ],
51- 'access ' => [
52- 'class ' => AccessControl::class,
53- 'rules ' => [
54- [
55- 'allow ' => true ,
56- 'roles ' => ['admin ' ],
57- ],
58- ],
59- ],
63+ 'access ' => $ this ->accessControlConfig ,
6064 ];
6165 }
6266
You can’t perform that action at this time.
0 commit comments