Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeks-semenov committed Dec 9, 2024
1 parent 81220ea commit 9b9e4d7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
17 changes: 11 additions & 6 deletions src/config/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
],
],
]
]

],

],
Expand Down
8 changes: 2 additions & 6 deletions src/controllers/AdminMeasureController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
}
Expand Down

0 comments on commit 9b9e4d7

Please sign in to comment.