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

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

问题描述

我正在开发一款应用程式,让Google Apps管理员可以重新分配文件所有权。目前,我正在使用C#代码的Google Drive SDK for .NET。



当我在 https://developers.google.com/drive/v2/reference/permissions/insert 并填写属于管理员的文件的 FileId 并尝试从同一个Google Apps域中插入另一个所有者我收到500内部服务器错误。我正在使用这些值:

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

Content-Type:application / json
Authorization:Bearer {MY_ACCESSTOKEN}
X-JavaScript-User-Agent:Google API资源管理器

{
角色:所有者,
类型:用户,
值:user@mydomain.com
}

试试看演示让我看到范围




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

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



    可以执行此操作。



我可以通过使用Try It demo进行身份验证来获取文件权限列表同一个管理员用户,但我无法插入删除所有者权限。



我选择了Google Drive SDK,因为它比较新,Google Docs API只是被删除,但我会愿意使用任何最好的工具来更新所有权。我只是在寻找到达目标的最直接路径。

有没有人获得所有权更新?如果是的话,你使用了什么工具?

解决方案

我为我们的工程师提出了一个内部错误进行调查,但是,我只设法在尝试与外部用户共享某个用户而不是来自同一个域的用户时重现此问题。



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



只要我听到回复,我会立即更新此答案来自我们的调查。


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.

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

    to do this operation.

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.

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 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 Update(删除/插入)在试用演示版中的所有者权限500错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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