From a2d420bb8b3ead515f01a62b272ea5baf4a14c57 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 2 May 2024 22:54:39 +0000 Subject: [PATCH] Went through todos --- Admin/Routes/Web/Api.php | 19 +++++++++++++++---- Theme/Backend/tag-view.tpl.php | 7 +++++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Admin/Routes/Web/Api.php b/Admin/Routes/Web/Api.php index d9bd5e1..427d05d 100755 --- a/Admin/Routes/Web/Api.php +++ b/Admin/Routes/Web/Api.php @@ -18,7 +18,7 @@ use phpOMS\Account\PermissionType; use phpOMS\Router\RouteVerb; return [ - '^.*/tag$' => [ + '^.*/tag(\?.*|$)$' => [ [ 'dest' => '\Modules\Tag\Controller\ApiController:apiTagCreate', 'verb' => RouteVerb::PUT, @@ -66,7 +66,7 @@ return [ ], ], ], - '^.*/tag/l11n$' => [ + '^.*/tag/l11n(\?.*|$)$' => [ [ 'dest' => '\Modules\Tag\Controller\ApiController:apiTagL11nCreate', 'verb' => RouteVerb::PUT, @@ -74,7 +74,7 @@ return [ 'active' => true, 'permission' => [ 'module' => ApiController::NAME, - 'type' => PermissionType::READ, + 'type' => PermissionType::CREATE, 'state' => PermissionCategory::TAG, ], ], @@ -85,7 +85,18 @@ return [ 'active' => true, 'permission' => [ 'module' => ApiController::NAME, - 'type' => PermissionType::READ, + 'type' => PermissionType::MODIFY, + 'state' => PermissionCategory::TAG, + ], + ], + [ + 'dest' => '\Modules\Tag\Controller\ApiController:apiTagL11nDelete', + 'verb' => RouteVerb::DELETE, + 'csrf' => true, + 'active' => true, + 'permission' => [ + 'module' => ApiController::NAME, + 'type' => PermissionType::DELETE, 'state' => PermissionCategory::TAG, ], ], diff --git a/Theme/Backend/tag-view.tpl.php b/Theme/Backend/tag-view.tpl.php index f9c9bad..673f609 100644 --- a/Theme/Backend/tag-view.tpl.php +++ b/Theme/Backend/tag-view.tpl.php @@ -53,10 +53,13 @@ echo $this->data['nav']->render(); ?>
-
+ data-add-tpl="#tagTable tbody .oms-add-tpl-tag" + >
getHtml('Tag'); ?>