mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
checks for if bucket is disabled
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user