From afd2c7a065d266db90088565044924362eccc78d Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Wed, 3 May 2023 12:03:23 -0700 Subject: [PATCH] Update migration to set bucket permissions in metadata table --- src/Appwrite/Migration/Version/V18.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Appwrite/Migration/Version/V18.php b/src/Appwrite/Migration/Version/V18.php index e55d62b0c5..be628e0fbb 100644 --- a/src/Appwrite/Migration/Version/V18.php +++ b/src/Appwrite/Migration/Version/V18.php @@ -182,6 +182,19 @@ class V18 extends Migration */ $document->setAttribute('options', $document->getAttribute('options', new \stdClass())); break; + case 'buckets': + /** + * Set the bucket permission in the metadata table + */ + try { + $internalBucketId = "bucket_{$this->project->getInternalId()}"; + $permissions = $document->getPermissions(); + $fileSecurity = $document->getAttribute('fileSecurity', false); + $this->projectDB->updateCollection($internalBucketId, $permissions, $fileSecurity); + } catch (\Throwable $th) { + Console::warning($th->getMessage()); + } + break; } return $document;