From 24e3dce192895fb2cc5c10dfb35834b5a53b9a19 Mon Sep 17 00:00:00 2001 From: iIronside Date: Fri, 23 Dec 2022 20:35:12 +0300 Subject: [PATCH] change permission for reports --- .../reports/controllers/ReportsController.php | 21 +++++++++++-------- backend/views/layouts/left.php | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/backend/modules/reports/controllers/ReportsController.php b/backend/modules/reports/controllers/ReportsController.php index 16ebefc..69f7cdd 100755 --- a/backend/modules/reports/controllers/ReportsController.php +++ b/backend/modules/reports/controllers/ReportsController.php @@ -23,21 +23,24 @@ class ReportsController extends Controller public function behaviors() { return [ + 'as AccessBehavior' => [ + 'class' => \developeruz\db_rbac\behaviors\AccessBehavior::className(), + ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ 'delete' => ['POST'], ], ], - 'access' => [ - 'class' => AccessControl::className(), - 'rules' => [ - [ - 'allow' => true, - 'roles' => ['admin'], - ], - ], - ], +// 'access' => [ +// 'class' => AccessControl::className(), +// 'rules' => [ +// [ +// 'allow' => true, +// 'roles' => ['admin'], +// ], +// ], +// ], ]; } diff --git a/backend/views/layouts/left.php b/backend/views/layouts/left.php index 11c0953..3ea52dc 100755 --- a/backend/views/layouts/left.php +++ b/backend/views/layouts/left.php @@ -93,7 +93,7 @@ ['label' => 'Доступы', 'icon' => 'key', 'url' => ['/accesses/accesses'], 'active' => \Yii::$app->controller->id == 'accesses', 'visible' => Yii::$app->user->can('confidential_information')], ['label' => 'Заметки', 'icon' => 'sticky-note', 'url' => ['/notes/notes'], 'active' => \Yii::$app->controller->id == 'notes', 'visible' => Yii::$app->user->can('confidential_information')], ['label' => 'Календарь ДР', 'icon' => 'calendar-check-o', 'url' => ['/calendar/calendar'], 'active' => \Yii::$app->controller->id == 'calendar', 'visible' => Yii::$app->user->can('confidential_information')], - ['label' => 'Отчеты', 'icon' => 'calendar', 'url' => ['/reports/reports'], 'active' => \Yii::$app->controller->id == 'reports', 'visible' => Yii::$app->user->can('confidential_information')], + ['label' => 'Отчеты', 'icon' => 'calendar', 'url' => ['/reports/reports'], 'active' => \Yii::$app->controller->id == 'reports', ], // 'visible' => Yii::$app->user->can('confidential_information') ['label' => 'Опции', 'icon' => 'list-alt', 'url' => ['/options/options'], 'active' => \Yii::$app->controller->id == 'options', 'visible' => Yii::$app->user->can('confidential_information')], [ 'label' => 'Запрос интервью (' . \common\models\InterviewRequest::getNewCount() . ')',