From 8a3cb78ef97392e69f1fb31e9354a0f81a944c37 Mon Sep 17 00:00:00 2001 From: Semenov Date: Mon, 13 Apr 2020 14:44:18 +0300 Subject: [PATCH] dev --- src/config/web.php | 4 ++-- src/controllers/AdminMeasureController.php | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/config/web.php b/src/config/web.php index a6ade66..e919111 100644 --- a/src/config/web.php +++ b/src/config/web.php @@ -24,14 +24,14 @@ "image" => ['\skeeks\cms\measure\assets\Asset', 'icons/misc.png'], ], - [ + /*[ "name" => ['skeeks/measure', 'Settings'], "url" => ["cms/admin-settings", "component" => 'skeeks\cms\measure\components\MeasureComponent'], "image" => ['skeeks\cms\assets\CmsAsset', 'images/icons/settings.png'], "activeCallback" => function ($adminMenuItem) { return (bool)(\Yii::$app->request->getUrl() == $adminMenuItem->getUrl()); }, - ], + ],*/ ], ], ], diff --git a/src/controllers/AdminMeasureController.php b/src/controllers/AdminMeasureController.php index 5477957..efa2d3e 100644 --- a/src/controllers/AdminMeasureController.php +++ b/src/controllers/AdminMeasureController.php @@ -34,6 +34,12 @@ public function init() $this->modelClassName = CmsMeasure::class; $this->generateAccessActions = false; + $this->accessCallback = function () { + if (!\Yii::$app->cms->site->is_default) { + return false; + } + return \Yii::$app->user->can($this->uniqueId); + }; parent::init(); }