I have setup a service account to copy a file a user uploads. How do I transfer the ownership to a different email address?
I have:
new_permission = {'value': 'me@example.com', 'type': 'user', 'role': 'owner', 'transferOwnership': True} # also tried "true" and "True"
r = service.permissions().update(fileId=id, permissionId=perm_id, body=new_permission).execute()
No transfer of ownership takes place and the owner continues to be my service account.
EDIT: No errors occur either; it just doesn't change the owner.
EDIT #2: I've also tried via https://developers.google.com/drive/v2/reference/permissions/update with no luck. I receive a 200 response but the owner is still my service account rather than "me@example.com":
{
"kind": "drive#permission",
"etag": "\"xxxxxxx/xxxxxxx-x\"",
"id": "xxxxxxxxxxx",
"selfLink": "https://www.googleapis.com/drive/v2/files/myfileid/permissions/xxxxxx",
"name": "myserviceaccount",
"emailAddress": "myserviceaccount@developer.gserviceaccount.com",
"domain": "developer.gserviceaccount.com",
"role": "owner",
"type": "user"
}
EDIT #3: I've also tried the "patch" method...I get the same result as the "update" method.