需要同意才能将文件的所有权转让给其他用户 [Google Drive API]

sky*_*ind 7 php google-api google-drive-api google-oauth google-api-php-client

我有一个与 1 个用户 - 所有者(Gmail 帐户)和第二个用户 - 作者(Google 服务帐户,如 @iam.gserviceaccount.com)共享的 Google 表格文件。

我使用此函数由用户 2 从用户 1 复制表,并再次使复制文件的所有者为用户 1:

$ownerPermission = new Google_Service_Drive_Permission([
'type'         => 'user', 
'role'         => 'owner',
'emailAddress' => 'user1@gmail.com'
]);
$requestOwnership = $service->permissions->create($newfileId, $ownerPermission, ['fields' => 'id', 'transferOwnership' => 'true']); 
Run Code Online (Sandbox Code Playgroud)

直到昨天一切都运转良好!现在,Google Drive API 返回错误:需要同意才能将文件的所有权转让给其他用户

如何修复它?

ale*_*e13 1

根据此处的问题跟踪器问题,这似乎按预期工作

接下来,这是预期的行为,因为目前云端硬盘不支持更改 gmail.com 帐户拥有的项目的所有权。

  • 我已经编辑了链接! (2认同)