SamiHuutoniemi
SamiHuutoniemi

Reputation: 1595

Is there any way to determine if a Google Drive file is shared to a certain group?

So, is it possible to determine whether a file is shared to a certain group by use of Google Drive API (Google Documents API is out of the question, it will be deprecated during next year)? Listing permissions by use of Google Drive API: List Permissions gives a list, in which all permissions related to groups have the email null. Another (extremely ugly) way I tried was to try and share the file with the group I want to check, to see if I would get an exception, but no. It happily reshares it. There must be someone else who has the need to check this except me!

Thanks

EDIT: The calls to the Google Drive API are done using the admin user, who owns the files.

Upvotes: 0

Views: 161

Answers (1)

Thibault Pouget
Thibault Pouget

Reputation: 81

You're right, you're not the only who needs this.

The Documents List API is a way to get the Group e-mail addresses: https://developers.google.com/google-apps/documents-list/#retrieving_the_acl_for_a_document_file_or_collection

But you should use getIdForEmail. It might help you achieve what you're trying to do.

Upvotes: 1

Related Questions