试用演示中的 Google Drive SDK 更新(删除/插入)所有者权限 500 错误 [英] Google Drive SDK Update (delete/insert) Owner Permission 500 Error in Try It Demo

查看:18
本文介绍了试用演示中的 Google Drive SDK 更新(删除/插入)所有者权限 500 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,它应该为 Google Apps 管理员提供重新分配文件所有权的能力.目前我正在使用带有 C# 代码的 Google Drive SDK for .NET.

I am developing an app that should provide a Google Apps Admin the ability to reassign ownership on files. Currently I am using the Google Drive SDK for .NET with C# code.

当我在 https://developers 的 Google Drive SDK 测试演示中进行身份验证时.google.com/drive/v2/reference/permissions/insert 并填写属于管理员的文件的 FileId 并尝试插入来自同一 Google Apps 域的另一个所有者我收到 500 内部服务器错误.我正在使用这些值:

When I authenticate in the Google Drive SDK test demo at https://developers.google.com/drive/v2/reference/permissions/insert and fill in the FileId of a file belonging to the Admin and try to insert another owner from the same Google Apps domain I get a 500 internal server error. I'm using these values:

POST     https://www.googleapis.com/drive/v2/files/0B1Y4_hVm0vbESlZuZHhBemtjcXM/permissions?key={YOUR_API_KEY}

Content-Type:  application/json
Authorization:  Bearer {MY_ACCESSTOKEN}
X-JavaScript-User-Agent:  Google APIs Explorer

{
 "role": "owner",
 "type": "user",
 "value": "user@mydomain.com"
}

试试看"演示为我设置了范围

The "Try It" demo sets me up with the scopes

  • https://www.googleapis.com/auth/drive

https://www.googleapis.com/auth/drive.file

做这个操作.

我可以通过使用以相同管理员用户身份验证的 Try It 演示来获取文件权限列表,但我无法插入删除所有者权限.

I am able to get a list of the permissions on the file by using the Try It demo authenticated as the same admin user, but I am unable to insert of delete owner permissions.

我选择了 Google Drive SDK,因为它更新并且 Google Docs API 刚刚被弃用,但我愿意使用任何最好的工具来更新所有权.我只是在寻找实现该目标的最直接路径.

I picked the Google Drive SDK because it is newer and the Google Docs API was just depricated, but I would be willing to use whatever was the best tool for updating the ownership. I'm just looking for the straightest path to that goal.

有人更新所有权吗?如果有,您使用的是什么工具?

Has anyone got the ownership update working? If so what tool did you use?

推荐答案

我提交了一个内部错误供我们的工程师进行调查,但是,我仅在尝试与来自外部域的用户共享时才设法重现该问题,而不是与来自同一域的一个.

I filed an internal bug for our engineers to investigate, however, I only managed to reproduce the issue when trying to share with an user from an external domain and not with one from the same domain.

Google Apps 域管理员可以阻止其用户将所有权更改为外部用户,但在这种情况下,API 不应返回 500,而是失败并显示描述性错误消息.

Google Apps domain admins can prevent their users from changing ownership to external users, but in that case the API should not return a 500 and instead fail with a descriptive error message.

我会在收到调查结果后立即更新此答案.

I'll update this answer as soon as I hear back from our investigation.

这篇关于试用演示中的 Google Drive SDK 更新(删除/插入)所有者权限 500 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆