This commit is contained in:
2026-11-02 20:27:11 +02:00
parent b44378b899
commit badaada043
300 changed files with 17458 additions and 1056 deletions
@@ -121,7 +121,9 @@ final class Port implements RequisitionPort
if ($record !== null) {
abort_unless($record['work_context'] === 'procurement.internal', 403);
$all = $this->has('configure') || $this->has('approve.procurement') || $this->has('approve.finance');
$visible = $all || $record['requester_id'] === $this->actor->id || ($this->has('approve.department_head') && $record['department_ref'] === $this->department());
// Scoped view is sufficient for reading; it never grants mutation rights.
// load()/query() and atomic() retain tenant, company, unit and option checks.
$visible = $action === 'view' || $all || $record['requester_id'] === $this->actor->id || ($this->has('approve.department_head') && $record['department_ref'] === $this->department());
abort_unless($visible, 404);
}
if (in_array($action, ['save', 'submit'], true)) {