security: round 2 — multi-tenancy isolation (OrganisationScope, scoped validation, boundary checks)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -172,6 +172,12 @@ final class PortalShiftController extends Controller
|
||||
|
||||
public function claim(Request $request, Event $event, Shift $shift): JsonResponse
|
||||
{
|
||||
// Verify shift belongs to this event context
|
||||
$eventIds = $this->resolveEventIds($event);
|
||||
if (! in_array($shift->festivalSection->event_id, $eventIds)) {
|
||||
return $this->notFound('Shift niet gevonden.');
|
||||
}
|
||||
|
||||
$person = $this->resolvePerson($event);
|
||||
|
||||
if ($person->status !== 'approved') {
|
||||
@@ -203,6 +209,12 @@ final class PortalShiftController extends Controller
|
||||
|
||||
public function cancel(Request $request, Event $event, ShiftAssignment $shiftAssignment): JsonResponse
|
||||
{
|
||||
// Verify assignment belongs to this event context
|
||||
$eventIds = $this->resolveEventIds($event);
|
||||
if (! in_array($shiftAssignment->shift->timeSlot->event_id, $eventIds)) {
|
||||
return $this->notFound('Dienst niet gevonden.');
|
||||
}
|
||||
|
||||
$person = $this->resolvePerson($event);
|
||||
|
||||
// Must be the person's own assignment
|
||||
|
||||
Reference in New Issue
Block a user