Reputation: 109
I am working on a .NET Google Drive app with scope drive.file. My app does not show up the list of shared files through the query Q = sharedWithMe. However, when I change my app's scope to drive the list of files appears. Why does it not work when the scope is set to drive.file? I created another project on Drive console and tested it but again it failed.
Upvotes: 2
Views: 675
Reputation: 21
In my experience, drive.file scope permissions seem inconsistent.
For example (all actions are performed by the app with drive.file scope):
I apologize for complexity of the above example, I can setup a simple javascript demo if that would be helpful.
I could not find anywhere in Google Drive documentation that claims any restrictions about accessing application created files on different accounts, so it might be a bug introduced trying to solve scope violation bugs last year.
For example: List ignores drive.file scope and shows shared files not created by the calling app
Upvotes: 1
Reputation: 10177
The Drive.Files scope states it only gives access to files opened or created by the app. The new API is more restrictive of file scope, I believe because Google is trying to push dev's to use the new google file picker (as a security measure), to get access to files not created by the app.
Your solutions are:
Update: I just tested, and can confirm your results. "Created by application" is not an attribute shared between accounts. It only affects the original account.
Upvotes: 1
Reputation: 46844
with Drive.File scope, each individual user needs to authorize your app to see the file.
Thus, if you share the file, the user its shared with needs to explicitly open the file with your app in order for you to view it in that context.
Upvotes: 1
Reputation: 22306
drive.file can only see files that were created with the app, or explicitly shared with the app. Sharing a file with the user is not enough, it needs to be shared with the app also.
Upvotes: 1