From 9b9e4d7faf69b61d229feab19c1d40869138d27e Mon Sep 17 00:00:00 2001 From: Semenov Date: Mon, 9 Dec 2024 10:55:14 +0300 Subject: [PATCH] dev --- src/config/web.php | 17 +++++++++++------ src/controllers/AdminMeasureController.php | 8 ++------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/config/web.php b/src/config/web.php index 97cf692..7f593f3 100644 --- a/src/config/web.php +++ b/src/config/web.php @@ -13,12 +13,17 @@ 'settings' => [ 'items' => [ - [ - "name" => ['skeeks/measure', 'Units of measurement'], - "url" => ["cms-measure/admin-measure"], - "image" => ['\skeeks\cms\measure\assets\Asset', 'icons/misc.png'], - ], - ], + 'list' => [ + 'items' => [ + [ + "name" => ['skeeks/measure', 'Units of measurement'], + "url" => ["cms-measure/admin-measure"], + "image" => ['\skeeks\cms\measure\assets\Asset', 'icons/misc.png'], + ], + ], + ] + ] + ], ], diff --git a/src/controllers/AdminMeasureController.php b/src/controllers/AdminMeasureController.php index 33c5627..59dff45 100644 --- a/src/controllers/AdminMeasureController.php +++ b/src/controllers/AdminMeasureController.php @@ -15,6 +15,7 @@ use skeeks\cms\helpers\RequestResponse; use skeeks\cms\kladr\models\KladrLocation; use skeeks\cms\measure\models\CmsMeasure; +use skeeks\cms\rbac\CmsManager; use skeeks\yii2\form\fields\FieldSet; use skeeks\yii2\form\fields\NumberField; use skeeks\yii2\form\fields\SelectField; @@ -34,12 +35,7 @@ public function init() $this->modelClassName = CmsMeasure::class; $this->generateAccessActions = false; - $this->accessCallback = function () { - if (!\Yii::$app->skeeks->site->is_default) { - return false; - } - return \Yii::$app->user->can($this->uniqueId); - }; + $this->permissionName = CmsManager::PERMISSION_ROLE_ADMIN_ACCESS; parent::init(); }