Restrict in-progress wash details by lane department

This commit is contained in:
Jeppe B
2026-06-02 00:19:55 +02:00
parent fbad5f767f
commit 7380bc729b
2 changed files with 10 additions and 3 deletions
@@ -124,7 +124,7 @@ class moduleSelfServeRoute
$lane_id = (int)$this->getParameter('lane_id');
self::requireType($lane_id, self::type_int());
self::requireMinValue($lane_id, 1);
$customer_scope = $this->requireInProgressWashDetailsAccess();
$customer_scope = $this->requireInProgressWashDetailsAccess($lane_id);
$build_customer = static function (?int $customer_number): ?array {
if ($customer_number === null || $customer_number <= 0) {
@@ -1228,7 +1228,7 @@ class moduleSelfServeRoute
]);
}
private function requireInProgressWashDetailsAccess(): ?int
private function requireInProgressWashDetailsAccess(int $lane_id): ?int
{
global $response;
@@ -1238,6 +1238,11 @@ class moduleSelfServeRoute
}
if (self::hasPermission('modules_selfserve_lane_wash_in_progress_view')) {
$department_lane = (new department_lanes_o())->select($lane_id);
if (!$department_lane->exists()) {
$response->error('Department lane not found', 404);
}
self::requireDepartmentAccess((string)$department_lane->department->value());
return null;
}