checks for if bucket is disabled

This commit is contained in:
Damodar Lohani
2021-11-18 20:43:18 +05:45
parent 3b290e1042
commit a6fc5820cc
+8 -8
View File
@@ -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);
}