0

I'd like to know if it's possible to query files by permission in drive API only if the permission email is a gmail (and obviously an existing account)

$results = $service->files->listFiles()

with

'[email protected]' in readers

doesn't return result

while

'[email protected]' in readers

does

with both addresses present in the permissions array of the files

thanks for any advice, so I don't waste time for something not possible (and I'll have to do it looping all the files in a folder to check for permissions)

3
  • 1
    is the person running the code owner of the file? Commented Jul 1 at 15:08
  • the code is running with a service account (owned by my gmail account in cloud services I use developing)
    – jthomas
    Commented Jul 3 at 7:12
  • Have you shared the file with the service account and made it owner. Remember a service account is not you its like a dummy user. Commented Jul 3 at 8:31

1 Answer 1

1

Interesting behavior, the query only seems to work if the target email address is associated with a google account.

People can bring their own email and create a google account.

So I can register and share files with my outlook.com account. In this case the query does return results.

If the account is not registered in google.com, then I don't get results. We should report this to google.

But to answer your question, yes it's possible if the account happens to be registered at google.

Not the answer you're looking for? Browse other questions tagged or ask your own question.