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 \cms \controllers ;
44
55use Yii ;
6- use yii \filters \AccessControl ;
76use yii \filters \VerbFilter ;
87use yii \web \Controller ;
98use yii \web \NotFoundHttpException ;
@@ -42,6 +41,19 @@ class ManageController extends Controller
4241 */
4342 public $ modelClass = 'yii2mod\cms\models\CmsModel ' ;
4443
44+ /**
45+ * @var array access control config
46+ */
47+ public $ accessControlConfig = [
48+ 'class ' => 'yii\filters\AccessControl ' ,
49+ 'rules ' => [
50+ [
51+ 'allow ' => true ,
52+ 'roles ' => ['admin ' ],
53+ ],
54+ ],
55+ ];
56+
4557 /**
4658 * @inheritdoc
4759 */
@@ -57,15 +69,7 @@ public function behaviors()
5769 'delete ' => ['post ' ],
5870 ],
5971 ],
60- 'access ' => [
61- 'class ' => AccessControl::class,
62- 'rules ' => [
63- [
64- 'allow ' => true ,
65- 'roles ' => ['admin ' ],
66- ],
67- ],
68- ],
72+ 'access ' => $ this ->accessControlConfig ,
6973 ];
7074 }
7175
You can’t perform that action at this time.
0 commit comments