-
Notifications
You must be signed in to change notification settings - Fork 491
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
Support Shared Drives #360
Comments
With v3.0.5, I got shared drives to work. Currently it doesn't work because the drive ID is hard-coded to google-drive-ruby/lib/google_drive/session.rb Line 414 in 264a000
I monkey patched this to the following: module GoogleDrive
# Monkey patches google-drive-ruby to support shared drives
class Session
def root_collection
@root_collection ||= file_by_id(ENV['GOOGLE_DRIVE_ID'])
end
end
end |
Hi, I don't think monkey patching is needed, it's not documented in the README, but it is possible to upload to shared GDrive folders ("collections" as per this library's source code): GoogleDrive::Session
.from_service_account_key(CONFIG)
.collection_by_url("https://drive.google.com/drive/folders/gF1dvxQfFeRcQgFOdgid0aAcM1q9i6K15")
.upload_from_file(file) Make sure to share to the |
Feature request: Add support for shared drives. If this is available now, I wasn't able to find documentation for it.
It looks like Team Drive support was added a couple of years ago (#259). Team Drive has since been renamed to "Shared Drives." The API documentation mentions a
supportsAllDrives
parameter that must be passed along with various requests, which might be the new version of thesupports_team_drives
parameter added at the time and still extant in v3.0.3 of the gem.Thanks!
The text was updated successfully, but these errors were encountered: