davidstrauss / google-drive-recursive-ownership

Tool to recursively give away file and document ownership to another user.
MIT License
269 stars 68 forks source link

Error when changing ownership of pdf files #4

Closed coloradotechie closed 4 years ago

coloradotechie commented 8 years ago

Hi,

On this line in the python code return service.permissions().update(fileId=drive_item['id'], permissionId=permission_id, body=permission, transferOwnership=True).execute()

I'm getting this error: An error occurred updating ownership permissions: <HttpError 403 when requesting https://www.googleapis.com/drive/v2/files/randomcharacters/permissions/some_numbers?transferOwnership=true&alt=json returned "Insufficient permissions for this file">

Does the code need to be updated to allow for ownership changes to files that have been uploaded to google drive?

davidstrauss commented 8 years ago

Uploaded files should not be any different from documents in the API. Indeed, most of the files I changed ownership for with this script were files, not native Google Docs.

Do you have more details on the error?

jcsahnwaldt commented 8 years ago

I simply can't transfer ownership of a JPEG or PDF, not even through the web interface. I have a standard ("consumer") Google account. What kind of account do you have?

Google says:

Google Apps Customers: Only Google Apps customers in Government and Education domains can transfer ownership of a synced or uploaded file (like a PDF or image file). Consumer Drive users: You can't transfer ownership of a synced or uploaded file (like a PDF or an image file).

mightyiam commented 8 years ago

This is the reason: "You can only transfer ownership of Google Docs, Sheets, Slides, or Forms"

Paraka321 commented 7 years ago

@mightyiam is correct for general Gmail use. However, G Suite users can use this to transfer ownership of any file type located in Google Drive. This is not a bug, but rather the way Google handles permissions across gmail domains.

davidstrauss commented 4 years ago

This is a limitation of the Google Drive product. Several folks here are correct that it's useful to transfer ownership among accounts on a G Suite Google Drive, which is what I originally wrote this for.

mightyiam commented 4 years ago

Thank you for following up, @davidstrauss.