diff --git a/src/config/web.php b/src/config/web.php index b6c100d..0f33b8e 100644 --- a/src/config/web.php +++ b/src/config/web.php @@ -12,6 +12,8 @@ 'data' => [ 'settings' => [ + 'items' => [ + 'list' => [ 'items' => [ [ "name" => ['skeeks/money', 'Currencies'], @@ -20,6 +22,8 @@ ], ], ], + ], + ], ], ], ], diff --git a/src/controllers/AdminCurrencyController.php b/src/controllers/AdminCurrencyController.php index e0ad440..d058454 100644 --- a/src/controllers/AdminCurrencyController.php +++ b/src/controllers/AdminCurrencyController.php @@ -16,6 +16,7 @@ use skeeks\cms\grid\BooleanColumn; use skeeks\cms\money\Currency; use skeeks\cms\money\models\MoneyCurrency; +use skeeks\cms\rbac\CmsManager; use skeeks\yii2\form\fields\BoolField; use yii\helpers\ArrayHelper; /** @@ -30,12 +31,7 @@ public function init() $this->modelClassName = MoneyCurrency::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(); } @@ -72,9 +68,9 @@ public function actions() ], 'columns' => [ 'custom' => [ - 'attribute' => 'name', + 'attribute' => 'name', 'viewAttribute' => 'asText', - 'class' => DefaultActionColumn::class, + 'class' => DefaultActionColumn::class, ], 'is_active' => [