Fix eligibility check by ensuring user is not null in lane access condition

This commit is contained in:
Jeppe Bundgaard
2026-06-29 15:35:26 +02:00
parent b492292642
commit 5f13242cfa
@@ -52,7 +52,7 @@ it('authorizes customer eligibility preview lanes before returning task attachme
expect($assertBlock)->toContain('bool $hasGlobalPermission = true')
->and($assertBlock)->toContain('bool $hasOwnPermission = false')
->and($assertBlock)->toContain('if ($hasGlobalPermission && $this->userHasLaneDepartmentAccess($user, $lane))')
->and($assertBlock)->toContain('if ($hasGlobalPermission && $user !== null && $this->userHasLaneDepartmentAccess($user, $lane))')
->and($assertBlock)->toContain('if ($hasOwnPermission && $this->isCustomerSelfServeLaneEnabled($lane))')
->and($assertBlock)->toContain('$this->forbidDepartmentAccess($lane_department_id);')
->and($assertBlock)->toContain('$response->forbidden([$elevatedPermission]);');