From 83341566bf29536fd43ba2093cf9a65ea215c259 Mon Sep 17 00:00:00 2001 From: Prem Palanisamy Date: Tue, 19 May 2026 17:40:16 +0100 Subject: [PATCH] Skip auth on platform-DB project update for policies write MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The platform 'projects' collection has document-level permissions restricted to team-owner roles. The migration worker has no team context, so the updateDocument call was being silently rejected by the authorization validator — the migration reported success because no exception bubbled up, but the destination project's auths attribute was left unchanged. Match the upstream Policies/Labels controllers' pattern by wrapping the write in $dbForPlatform->getAuthorization()->skip(...). --- src/Migration/Destinations/Appwrite.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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);