Skip to content

Commit 68b3431

Browse files
author
Igor Chepurnoy
authored
Merge branch 'master' into add_file_upload
2 parents ef5b6c7 + 3d1526a commit 68b3431

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

controllers/ManageController.php

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use yii\web\UploadedFile;
1010
use yii2mod\cms\models\CmsModel;
1111
use yii2mod\editable\EditableAction;
12-
use yii2mod\rbac\filters\AccessControl;
1312

1413
/**
1514
* Class ManageController
@@ -47,6 +46,21 @@ class ManageController extends Controller
4746
* @var string model class name for attachment model
4847
*/
4948
public $attachmentModelClass = 'yii2mod\cms\models\AttachmentModel';
49+
50+
/**
51+
*
52+
* @var array access control config
53+
*/
54+
public $accessControlConfig = [
55+
'class' => 'yii\filters\AccessControl',
56+
'rules' => [
57+
[
58+
'allow' => true,
59+
'roles' => ['admin'],
60+
],
61+
],
62+
];
63+
5064

5165
/**
5266
* @inheritdoc
@@ -64,15 +78,7 @@ public function behaviors()
6478
'file-upload' => ['post'],
6579
],
6680
],
67-
'access' => [
68-
'class' => AccessControl::class,
69-
'rules' => [
70-
[
71-
'allow' => true,
72-
'roles' => ['admin'],
73-
],
74-
],
75-
],
81+
'access' => $this->accessControlConfig,
7682
];
7783
}
7884

0 commit comments

Comments
 (0)