From d6f730fa3e442240b6cb85bf54e7f23a8f05a7bd Mon Sep 17 00:00:00 2001 From: hager Date: Wed, 2 Sep 2026 12:21:29 +0000 Subject: [PATCH] fix(empty-return-requests): show the queue to the staff who run returns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The menu item was gated on the brand-new empty_return_requests:view key, which on the dev DB is held by one position (Operations Chief) — so the Director and Dispatcher who already work Container Returns two rows above it never saw the entry at all. Viewing the queue now accepts that key OR warehouse_inventory:view, the key the rest of the Imports menu runs on, in the sidebar, the route guard and the API's read routes alike. Approving and rejecting stay on the review key on their own, and the buttons come up disabled (with the reason) for a viewer who lacks it rather than firing into a 403. The dedicated keys are still there to hand out per position whenever that call gets made. Co-Authored-By: Claude Opus 5 (1M context) --- .../backoffice/src/pages/warehouses/EmptyReturnRequestsPage.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/edr-freight-web/backoffice/src/pages/warehouses/EmptyReturnRequestsPage.tsx b/apps/edr-freight-web/backoffice/src/pages/warehouses/EmptyReturnRequestsPage.tsx index 0a3765d01..faec5dc2a 100644 --- a/apps/edr-freight-web/backoffice/src/pages/warehouses/EmptyReturnRequestsPage.tsx +++ b/apps/edr-freight-web/backoffice/src/pages/warehouses/EmptyReturnRequestsPage.tsx @@ -18,6 +18,8 @@ import { } from "@mantine/core"; import { DataTable, type ColumnDef } from "@edr/ui-common"; +import { useAuth } from "@/auth/useAuth"; +import { FREIGHT_PERMS, hasPermission } from "@/lib/permissions"; import { PageContainer, PageHeader } from "@/components/page"; import ListControls from "@/components/common/ListControls"; import { extractErrorMessage } from "@/components/warehouses/options";