From 78bd6611ba9cebb8238cdec5d27cf3a6057e7737 Mon Sep 17 00:00:00 2001 From: casperiv0 <53900565+casperiv0@users.noreply.github.com> Date: Thu, 19 Oct 2023 08:12:34 +0200 Subject: [PATCH] fix: unable to re-order penal code group positions --- apps/api/src/lib/values/utils.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/api/src/lib/values/utils.ts b/apps/api/src/lib/values/utils.ts index f90021eb0..535804498 100644 --- a/apps/api/src/lib/values/utils.ts +++ b/apps/api/src/lib/values/utils.ts @@ -66,6 +66,13 @@ export function getPermissionsForValuesRequest(request: Req) { throw new BadRequest("Must specify `params.path`"); } + if (path.toLowerCase() === "penal_code_group") { + return { + permissions: [Permissions.ManageValuePenalCode], + fallback: (u: User) => u.rank !== Rank.USER, + }; + } + const type = getTypeFromPath(path) as ValueType | "ALL"; if (type === "ALL") { return {