mirror of
https://github.com/affaan-m/ECC.git
synced 2026-10-15 20:55:28 +02:00
Merge remote-tracking branch 'refs/remotes/pr/3269' into maint/stewardship-batch-2026-09-30
# Conflicts: # manifests/context-packs/skill-triggers@1.json
This commit is contained in:
@@ -779,13 +779,13 @@ $path = $request->file('document')->store('documents', 'local');
|
||||
// Use signed URLs for temporary file access
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
public function download(Request $request, string $path)
|
||||
public function download(Document $document)
|
||||
{
|
||||
// Generate temporary signed URL (expires in 15 minutes)
|
||||
$url = Storage::temporaryUrl($path, now()->addMinutes(15));
|
||||
// Authorize against the model that owns the file, never a path taken from the request
|
||||
$this->authorize('download', $document);
|
||||
|
||||
// Validate user has permission
|
||||
$this->authorize('download', $path);
|
||||
// Generate the temporary signed URL (expires in 15 minutes) only after authorization
|
||||
$url = Storage::disk('s3')->temporaryUrl($document->path, now()->addMinutes(15));
|
||||
|
||||
return redirect($url);
|
||||
}
|
||||
|
||||
@@ -779,13 +779,13 @@ $path = $request->file('document')->store('documents', 'local');
|
||||
// Use signed URLs for temporary file access
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
public function download(Request $request, string $path)
|
||||
public function download(Document $document)
|
||||
{
|
||||
// Generate temporary signed URL (expires in 15 minutes)
|
||||
$url = Storage::temporaryUrl($path, now()->addMinutes(15));
|
||||
// Authorize against the model that owns the file, never a path taken from the request
|
||||
$this->authorize('download', $document);
|
||||
|
||||
// Validate user has permission
|
||||
$this->authorize('download', $path);
|
||||
// Generate the temporary signed URL (expires in 15 minutes) only after authorization
|
||||
$url = Storage::disk('s3')->temporaryUrl($document->path, now()->addMinutes(15));
|
||||
|
||||
return redirect($url);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user