@@ -139,7 +139,9 @@ final class PrivateAuditExporter
|
||||
$scope = app(PrivateAuditAccess::class)->authorise($candidate, $export->families);
|
||||
$actor = $scope['actor'];
|
||||
abort_unless($export->tenant_id === $actor->tenant_id && $export->created_by === $actor->id, 404);
|
||||
abort_unless($scope['context'] === $export->work_context, 409, 'Seleccione o contexto original da exportação.');
|
||||
abort_unless($scope['context'] === $export->work_context
|
||||
|| in_array($export->id, app(PrivateAuditAccess::class)->legacyExportIds($actor, $scope['context']), true),
|
||||
409, 'Seleccione o contexto original da exportação.');
|
||||
$prefix = 'audit-exports/'.$actor->tenant_id.'/'.$actor->id.'/';
|
||||
abort_unless(preg_match('/^'.preg_quote($prefix, '/').'[a-f0-9-]{36}\/auditoria\.zip$/D', $export->path) === 1, 409);
|
||||
$disk = Storage::disk('local');
|
||||
|
||||
Reference in New Issue
Block a user