diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index baa0b610d6..20bc7267e8 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -520,7 +520,7 @@ App::post('/v1/storage/buckets/:bucketId/files') $bucket = $dbForInternal->getDocument('buckets', $bucketId); - if($bucket->isEmpty()) { + if($bucket->isEmpty() || !$bucket->getAttribute('enabled')) { throw new Exception('Bucket not found', 404); } @@ -699,7 +699,7 @@ App::get('/v1/storage/buckets/:bucketId/files') $bucket = $dbForInternal->getDocument('buckets', $bucketId); - if($bucket->isEmpty()) { + if($bucket->isEmpty() || !$bucket->getAttribute('enabled')) { throw new Exception('Bucket not found', 404); } @@ -780,7 +780,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId') $bucket = $dbForInternal->getDocument('buckets', $bucketId); - if($bucket->isEmpty()) { + if($bucket->isEmpty() || !$bucket->getAttribute('enabled')) { throw new Exception('Bucket not found', 404); } @@ -858,7 +858,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') } $bucket = $dbForInternal->getDocument('buckets', $bucketId); - if($bucket->isEmpty()) { + if($bucket->isEmpty() || !$bucket->getAttribute('enabled')) { throw new Exception('Bucket not found', 404); } @@ -1016,7 +1016,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download') $bucket = $dbForInternal->getDocument('buckets', $bucketId); - if($bucket->isEmpty()) { + if($bucket->isEmpty() || !$bucket->getAttribute('enabled')) { throw new Exception('Bucket not found', 404); } @@ -1103,7 +1103,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view') $bucket = $dbForInternal->getDocument('buckets', $bucketId); - if($bucket->isEmpty()) { + if($bucket->isEmpty() || !$bucket->getAttribute('enabled')) { throw new Exception('Bucket not found', 404); } @@ -1205,7 +1205,7 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId') $bucket = $dbForInternal->getDocument('buckets', $bucketId); - if($bucket->isEmpty()) { + if($bucket->isEmpty() || !$bucket->getAttribute('enabled')) { throw new Exception('Bucket not found', 404); } @@ -1284,7 +1284,7 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId') $bucket = $dbForInternal->getDocument('buckets', $bucketId); - if($bucket->isEmpty()) { + if($bucket->isEmpty() || !$bucket->getAttribute('enabled')) { throw new Exception('Bucket not found', 404); }