From 1db4717c958785ebaf3033aafddf6b6118406d8a Mon Sep 17 00:00:00 2001 From: saba_zedginidze Date: Mon, 8 Apr 2024 13:30:11 +0400 Subject: [PATCH] [MODORDERS-1006] Add permissions and create private constructor for util class --- descriptors/ModuleDescriptor-template.json | 40 ++++++++++++++++++- .../validators/RoutingListValidatorUtil.java | 2 + 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/descriptors/ModuleDescriptor-template.json b/descriptors/ModuleDescriptor-template.json index 375082e46..413796fef 100644 --- a/descriptors/ModuleDescriptor-template.json +++ b/descriptors/ModuleDescriptor-template.json @@ -1003,6 +1003,31 @@ "id": "orders.routing-list", "version": "1.0", "handlers": [ + { + "methods": ["GET"], + "pathPattern": "/orders/routing-lists", + "permissionsRequired": ["orders-storage.routing-lists.collection.get"] + }, + { + "methods": ["POST"], + "pathPattern": "/orders/routing-lists", + "permissionsRequired": ["orders-storage.routing-lists.item.post"] + }, + { + "methods": ["GET"], + "pathPattern": "/orders/routing-lists/{id}", + "permissionsRequired": ["orders-storage.routing-lists.item.get"] + }, + { + "methods": ["PUT"], + "pathPattern": "/orders/routing-lists/{id}", + "permissionsRequired": ["orders-storage.routing-lists.item.put"] + }, + { + "methods": ["DELETE"], + "pathPattern": "/orders/routing-lists/{id}", + "permissionsRequired": ["orders-storage.routing-lists.item.delete"] + }, { "methods": ["GET"], "pathPattern": "/orders/routing-lists/{id}/template", @@ -1736,6 +1761,19 @@ "displayName" : "orders routing-list-template item get", "description" : "Orders routing-list-template item get" }, + { + "permissionName" : "orders.routing-lists.all", + "displayName" : "All routing list perms", + "description" : "All permissions for the routing list", + "subPermissions" : [ + "orders-storage.routing-lists.collection.get", + "orders-storage.routing-lists.item.post", + "orders-storage.routing-lists.item.get", + "orders-storage.routing-lists.item.put", + "orders-storage.routing-lists.item.delete", + "orders.routing-list-template.item.get" + ] + }, { "permissionName": "orders.all", "displayName": "orders - all permissions", @@ -1771,7 +1809,7 @@ "orders.holding-summary.collection.get", "orders.acquisition-methods.all", "orders.export-history.all", - "orders.routing-list-template.item.get" + "orders.routing-lists.all" ] }, { diff --git a/src/main/java/org/folio/service/routinglists/validators/RoutingListValidatorUtil.java b/src/main/java/org/folio/service/routinglists/validators/RoutingListValidatorUtil.java index a94146eaa..3f68e28d9 100644 --- a/src/main/java/org/folio/service/routinglists/validators/RoutingListValidatorUtil.java +++ b/src/main/java/org/folio/service/routinglists/validators/RoutingListValidatorUtil.java @@ -11,6 +11,8 @@ public class RoutingListValidatorUtil { + private RoutingListValidatorUtil() { } + public static List validateRoutingList(RoutingListCollection rListExisting, PoLine poLine) { List errors = new ArrayList<>(); if (poLine == null) {