Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Drive SDK Update (delete/insert) Owner Permission 500 Error in Try It Demo

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": "[email protected]"
}

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?

like image 252
Mark Stouffer Avatar asked Nov 13 '22 21:11

Mark Stouffer


1 Answers

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.

like image 133
Claudio Cherubino Avatar answered Jan 04 '23 01:01

Claudio Cherubino