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

Delete/Trash files when authenticating with a Service Account #351

Open
lpares12 opened this issue Jul 5, 2024 · 2 comments
Open

Delete/Trash files when authenticating with a Service Account #351

lpares12 opened this issue Jul 5, 2024 · 2 comments
Labels
question Further information is requested

Comments

@lpares12
Copy link

lpares12 commented Jul 5, 2024

Hi!

So I need to use service account authentication since I'm in a headless setup with no GUI access in the machine. So I have created a service account, shared the drive folder with that account and given it Editor permissions.

The problem is that I can't seem to remove files like this. I googled a bit and turns out Editors can't remove files from Drive. So I'm wondering if there's any approach with PyDrive2 to have a headless setup and to be able to remove files.

Any alternatives will be appreciated!

Also trashing the files would be okay, but can't do that either.

@shcheklein
Copy link
Member

I think yes, you should be able to list files and delete them with the api. Have you tried it? In a similar way to the regular drive.

@shcheklein shcheklein added the question Further information is requested label Jul 5, 2024
@lpares12
Copy link
Author

lpares12 commented Jul 5, 2024

Service accounts don't seem to have permissions for deleting or trash/untrash. I was wondering if there's any other way I can headlessly authenticate with PyDrive2. But that would force me to log in with the admin account anyways, which is not ideal. Seems like a Drive limitation.

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

No branches or pull requests

2 participants