commit14
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user