diff --git a/src/Migration/Destinations/Appwrite.php b/src/Migration/Destinations/Appwrite.php index 813d31027b..0b8e5f09e6 100644 --- a/src/Migration/Destinations/Appwrite.php +++ b/src/Migration/Destinations/Appwrite.php @@ -3411,11 +3411,14 @@ class Appwrite extends Destination $auths['membershipsMfa'] = $resource->getMembershipsUserMfa(); $auths['membershipsUserPhone'] = $resource->getMembershipsUserPhone(); - $this->dbForPlatform->updateDocument( + // The projects document is restricted to team-owner role on update; + // we're running in the migration worker which has no team context, so + // skip authorization the same way the upstream policy controllers do. + $this->dbForPlatform->getAuthorization()->skip(fn () => $this->dbForPlatform->updateDocument( 'projects', $this->projectId, new UtopiaDocument(['auths' => $auths]), - ); + )); $this->dbForPlatform->purgeCachedDocument('projects', $this->projectId);