Skip to content

Commit cba63fd

Browse files
author
Igor Chepurnoy
committed
added AccessControl to ManageController
1 parent be1440e commit cba63fd

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

controllers/DefaultController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function behaviors()
7070
return [
7171
'access' => [
7272
'class' => AccessControl::class,
73-
'only' => ['quick-edit'],
73+
'only' => ['quick-edit', 'delete'],
7474
'rules' => [
7575
[
7676
'allow' => true,

controllers/ManageController.php

+10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace yii2mod\comments\controllers;
44

55
use Yii;
6+
use yii\filters\AccessControl;
67
use yii\filters\VerbFilter;
78
use yii\web\Controller;
89
use yii\web\NotFoundHttpException;
@@ -47,6 +48,15 @@ public function behaviors()
4748
'delete' => ['post'],
4849
],
4950
],
51+
'access' => [
52+
'class' => AccessControl::class,
53+
'rules' => [
54+
[
55+
'allow' => true,
56+
'roles' => ['admin'],
57+
],
58+
],
59+
],
5060
];
5161
}
5262

0 commit comments

Comments
 (0)