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:
@@ -71,7 +71,8 @@ final class ShiftController extends Controller
|
||||
{
|
||||
Gate::authorize('assign', [$shift, $event, $section]);
|
||||
|
||||
$person = Person::findOrFail($request->validated('person_id'));
|
||||
$festivalEventId = $event->parent_event_id ?? $event->id;
|
||||
$person = Person::where('event_id', $festivalEventId)->findOrFail($request->validated('person_id'));
|
||||
$assignment = $this->shiftAssignmentService->assign($shift, $person, $request->user());
|
||||
|
||||
return $this->created(new ShiftAssignmentResource($assignment));
|
||||
@@ -81,7 +82,8 @@ final class ShiftController extends Controller
|
||||
{
|
||||
Gate::authorize('claim', [$shift, $event, $section]);
|
||||
|
||||
$person = Person::findOrFail($request->validated('person_id'));
|
||||
$festivalEventId = $event->parent_event_id ?? $event->id;
|
||||
$person = Person::where('event_id', $festivalEventId)->findOrFail($request->validated('person_id'));
|
||||
$assignment = $this->shiftAssignmentService->claim($shift, $person);
|
||||
|
||||
return $this->created(new ShiftAssignmentResource($assignment));
|
||||
|
||||
Reference in New Issue
Block a user