diff --git a/src/config/web.php b/src/config/web.php index 3107f70..17b0cd6 100644 --- a/src/config/web.php +++ b/src/config/web.php @@ -11,7 +11,7 @@ 'menu' => [ 'data' => [ - 'other' => [ + 'settings' => [ 'items' => [ [ "name" => ['skeeks/money', 'Currencies'], @@ -25,7 +25,7 @@ "image" => ['\skeeks\cms\money\assets\Asset', 'images/money_16_16.png'], ], - [ + /*[ "name" => ['skeeks/money', 'Settings'], "url" => [ "cms/admin-settings", @@ -35,7 +35,7 @@ "activeCallback" => function ($adminMenuItem) { return (bool)(\Yii::$app->request->getUrl() == $adminMenuItem->getUrl()); }, - ], + ],*/ ], ], ], diff --git a/src/controllers/AdminCurrencyController.php b/src/controllers/AdminCurrencyController.php index a39cbc6..cb67ea0 100644 --- a/src/controllers/AdminCurrencyController.php +++ b/src/controllers/AdminCurrencyController.php @@ -30,6 +30,12 @@ public function init() $this->modelClassName = MoneyCurrency::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(); }