1
0
Fork 0
mirror of synced 2024-05-20 04:32:37 +12:00

fix: migration team memberships and permissions

This commit is contained in:
Torsten Dittmann 2021-12-31 15:03:25 +01:00
parent 3730e33b0c
commit cf3136e51c

View file

@ -78,8 +78,7 @@ class V11 extends Migration
try {
$project = $this->dbConsole->getDocument(collection: 'projects', id: $oldProject->getId());
} catch (\Throwable $th) {
var_dump($th->getTraceAsString());
var_dump($th);
Console::error($th->getTraceAsString());
}
/**
@ -588,6 +587,19 @@ class V11 extends Migration
$write = $document->getWrite();
$document->setAttribute('$write', str_replace('user:{self}', "user:{$document->getId()}", $write));
break;
case OldDatabase::SYSTEM_COLLECTION_TEAMS:
/**
* Replace team:{self} with team:TEAM_ID
*/
$read = $document->getWrite();
$write = $document->getWrite();
$document->setAttribute('$read', str_replace('team:{self}', "team:{$document->getId()}", $read));
$document->setAttribute('$write', str_replace('team:{self}', "team:{$document->getId()}", $write));
break;
case OldDatabase::SYSTEM_COLLECTION_FILES:
/**