1
0
Fork 0
mirror of synced 2024-07-02 05:00:33 +12:00

Update migration to set bucket permissions in metadata table

This commit is contained in:
Steven Nguyen 2023-05-03 12:03:23 -07:00
parent ba24c0a843
commit afd2c7a065
No known key found for this signature in database

View file

@ -182,6 +182,19 @@ class V18 extends Migration
*/ */
$document->setAttribute('options', $document->getAttribute('options', new \stdClass())); $document->setAttribute('options', $document->getAttribute('options', new \stdClass()));
break; 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; return $document;