Update create and update bucket APIs
Ensure the permissions and document security are updated in the metadata collection.
This commit is contained in:
parent
afd2c7a065
commit
4dd6a7977e
1 changed files with 2 additions and 1 deletions
|
@ -128,7 +128,7 @@ App::post('/v1/storage/buckets')
|
|||
|
||||
$bucket = $dbForProject->getDocument('buckets', $bucketId);
|
||||
|
||||
$dbForProject->createCollection('bucket_' . $bucket->getInternalId(), $attributes, $indexes);
|
||||
$dbForProject->createCollection('bucket_' . $bucket->getInternalId(), $attributes, $indexes, permissions: $permissions ?? [], documentSecurity: $fileSecurity);
|
||||
} catch (Duplicate) {
|
||||
throw new Exception(Exception::STORAGE_BUCKET_ALREADY_EXISTS);
|
||||
}
|
||||
|
@ -274,6 +274,7 @@ App::put('/v1/storage/buckets/:bucketId')
|
|||
->setAttribute('encryption', $encryption)
|
||||
->setAttribute('compression', $compression)
|
||||
->setAttribute('antivirus', $antivirus));
|
||||
$dbForProject->updateCollection('bucket_' . $bucket->getInternalId(), $permissions, $fileSecurity);
|
||||
|
||||
$events
|
||||
->setParam('bucketId', $bucket->getId())
|
||||
|
|
Loading…
Reference in a new issue