Delete a file from different owner with Google Drive API

后端 未结 1 976
不思量自难忘°
不思量自难忘° 2020-12-20 04:52

I\'m trying to do a small application that reads a shared folder with different users of my organization, get the files and then delete them.

The problem is that I c

相关标签:
1条回答
  • 2020-12-20 05:14

    The best solution right now involves two steps:

    1. As the admin account, determine the current owner for each file.
    2. Using delegated authorization, impersonate the owner of each file and transfer ownership to the admin account.

    The email address of the owner is required to use delegated authorization, but isn't always visible in the permissions objects returned by the API. The email address will be visible if either:

    • The user has a Google+ account, their profile's "Contact Information" section includes their primary email address, and the email address's visibility is set to a level that includes the admin account.
    • The user is in a Google Apps domain and the domain has enabled contact sharing in the Admin console under "Google Apps > Contacts > Advanced settings".
    0 讨论(0)
提交回复
热议问题