mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Skip auth on platform-DB project update for policies write
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(...).
This commit is contained in:
1 parent
e998c64a7e
commit
83341566bf
1 file changed
+5
-2
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user