Skip to content

Commit

Permalink
added AccessControl to ManageController
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Chepurnoy committed Apr 16, 2017
1 parent be1440e commit cba63fd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function behaviors()
return [
'access' => [
'class' => AccessControl::class,
'only' => ['quick-edit'],
'only' => ['quick-edit', 'delete'],
'rules' => [
[
'allow' => true,
Expand Down
10 changes: 10 additions & 0 deletions controllers/ManageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace yii2mod\comments\controllers;

use Yii;
use yii\filters\AccessControl;
use yii\filters\VerbFilter;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
Expand Down Expand Up @@ -47,6 +48,15 @@ public function behaviors()
'delete' => ['post'],
],
],
'access' => [
'class' => AccessControl::class,
'rules' => [
[
'allow' => true,
'roles' => ['admin'],
],
],
],
];
}

Expand Down

0 comments on commit cba63fd

Please sign in to comment.