Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission Denied #9

Open
Luperi opened this issue Aug 3, 2016 · 13 comments
Open

Permission Denied #9

Luperi opened this issue Aug 3, 2016 · 13 comments

Comments

@Luperi
Copy link

Luperi commented Aug 3, 2016

I'm on my Mac and i'm executing the script in this way:
python transfer.py /Users/luca/Google\ Drive/New_Folder\ Custom/ true

When I run the script I get the error below.

schermata 2016-08-03 alle 20 05 57

@helio-silva
Copy link

Got insufficient permissions
Item folder/subfolder/photoHiRes.jpg needs ownership granted.
Upgrading existing permissions to ownership.
and them this error:
An error occurred updating ownership permissions: <HttpError 403 when requesting https://www.googleapis.com/drive/v2/files/0B9Y3CeAxHt4RVU5Qd216MWwtS1E/permissions/16600970269708598941?alt=json&transferOwnership=true returned "Insufficient permissions for this file">

@Paraka321
Copy link
Contributor

Luperi, are you still having this issue?

helio-silva, can I get some more information from you? It looks like you are trying to change permissions on a jpg file. Are you using a personal gmail account (ends in @gmail.com) or are you part of a school/business/government organization that uses gmail to check email for accounts that do not end in @gmail.com? If you are using a personal account or G-Suite for Business account you will not be able to change permissions on a jpg file with this tool. This is hard-coded into Google's permission scheme; you can only change permission on Google-based documents (Docs, Sheets, Slides, etc). See the README for more information.

@davidstrauss
Copy link
Owner

davidstrauss commented Jun 12, 2017

If you are using a personal account or G-Suite for Business account you will not be able to change permissions on a jpg file with this tool. This is hard-coded into Google's permission scheme; you can only change permission on Google-based documents (Docs, Sheets, Slides, etc). See the README for more information.

I don't believe this is correct. I originally wrote this script (and used it) to hand off ownership of objects including non-Google-documents from one user within a G Suite organization to another.

What I think this script can't do is hand-off ownership between non-G Suite accounts or G Suite accounts that are part of different organization.

@Paraka321
Copy link
Contributor

I don't believe this is correct. I originally wrote this script (and used it) to hand off ownership of objects including non-Google-documents from one user within a G Suite organization to another.

What I think this script can't do is hand-off ownership between non-G Suite accounts or G Suite accounts that are part of different organization.

I think on one of the other issue threads we talked about this. If I remember correctly you created this while working under a G Suite domain, which causes all of the pieces to work as expected. Personal Gmail accounts can only move files that were 'created' by the user, not 'uploaded' by the user. Since the only files that can be created are Google files, personal accounts can only change permissions on Google files. This is not something that can even be done manually through the GUI and it is unlikely that the API would allow this extra functionality.

You are correct that permissions cannot be changed across domains. This is also hard-coded into Google's permissions.

@davidstrauss
Copy link
Owner

davidstrauss commented Jun 12, 2017

I think on one of the other issue threads we talked about this. If I remember correctly you created this while working under a G Suite domain, which causes all of the pieces to work as expected. Personal Gmail accounts can only move files that were 'created' by the user, not 'uploaded' by the user. Since the only files that can be created are Google files, personal accounts can only change permissions on Google files. This is not something that can even be done manually through the GUI and it is unlikely that the API would allow this extra functionality.

Yes, this is all correct. I was correcting this comment that you posted earlier:

If you are using a personal account or G-Suite for Business account you will not be able to change permissions on a jpg file with this tool.

This tool should work for moving ownership of a JPG file between users in a G Suite account. Did you mean to say "between a G Suite user and a personal account"?

@Paraka321
Copy link
Contributor

This tool should work for moving ownership of a JPG file between users in a G Suite account.

I just tried testing a JPG with a personal gmail account to another personal gmail account. I was unable to move it with the script or from the GUI. Instead I get the following error:

Item test\File_000.jpeg needs ownership granted. Upgrading existing permissions to ownership. An error occurred updating ownership permissions: <HttpError 403 when requesting https://www.googleapis.com/drive/v2/files/0B-kZ41hEUm_8aGxFM3hyTVFCbVk/permissions/03173207988037715799?alt=json&transferOwnership=true returned "Insufficient permissions for this file">

@davidstrauss
Copy link
Owner

davidstrauss commented Jun 12, 2017

I just tried testing a JPG with a personal gmail account to another personal gmail account. I was unable to move it with the script or from the GUI.

I think you need to review what I'm saying. I never said that would work. (Rather, I said it wouldn't.) The tool works to move documents and regular files between users in a G Suite organization.

It does not work (and cannot work) to move ownership of regular files (like JPGs):

  • Between two personal Google accounts.
  • Between a personal Google account and a G Suite account.
  • Between G Suite accounts in different organizations.

@Paraka321
Copy link
Contributor

Paraka321 commented Jun 12, 2017

I don't believe this is correct.

I think this is the source of my confusion and the start of our discussion.

It does not work (and cannot work) to move ownership of regular files (like JPGs):

  • Between two personal Google accounts.
  • Between a personal Google account and a G Suite account.
  • Between G Suite accounts in different organizations.

This is correct. That is what I was trying to communicate.

@helio-silva
Copy link

Got insufficient permissions
Item folder/subfolder/photoHiRes.jpg needs ownership granted.
Upgrading existing permissions to ownership.
and them this error:
An error occurred updating ownership permissions: <HttpError 403 when requesting https://www.googleapis.com/drive/v2/files/0B9Y3CeAxHt4RVU5Qd216MWwtS1E/permissions/16600970269708598941?alt=json&transferOwnership=true returned "Insufficient permissions for this file">

@helio-silva
Copy link

I'm a photographer using my personal account at google drive to share jpeg's with family and friends. Since my disk space started to shrink I'm trying to find a way change ownership of these photos.

@Paraka321
Copy link
Contributor

Got insufficient permissions
Item folder/subfolder/photoHiRes.jpg needs ownership granted.

@helio-silva That looks like the error I posted above. See the conversation above. One of the three situations outlined by @davidstrauss must be true.

@Paraka321
Copy link
Contributor

I'm a photographer using my personal account at google drive to share jpeg's with family and friends. Since my disk space started to shrink I'm trying to find a way change ownership of these photos.

Google does not allow for this. You will not be able to use this project to circumvent Google's permissions.

@helio-silva
Copy link

Even moving data to other accounts I'm still owner of jpeg.
It looks like Google Drive is a trap for photographers I should move to other service
thank you guys for your help and nice shared code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants