As far as I can tell, this is not possible with the Google Picker API, but the Drive API may help.
I went over the Google Picker documentation. As you may have seen already, the picker is created with PickerBuilder()
, which takes View
objects to determine which files will be visible. The DocsView
subclass has a setOwnedByMe()
method to only show or exclude files that you own, however, this does not check for editor status, and there are no other methods that could do it.
View
does have a setQuery()
method, which seemed promising to add a search query, but I tested it and it uses the Drive UI advanced search syntax, which does not have a way to check for editors either. In fact, setQuery()
only prepopulates the search field already included in the picker.
As an alternative, since you already plan to use the Drive API you could take the selected file IDs from the picker's Response.DOCUMENTS
and then plug them in to files.get
to first validate whether or not the user has editor access and show a warning before proceeding so they will at least know which files cannot be shared.
Also, files.list
has a search guide that you can check out, and the q
parameter does allow searching for editor status with the query 'test@example.org' in writers
. If you really need to only show these files you could write an app that uses only the Drive API instead of Google Picker. PickerBuilder()
generates a live object connected to Drive so there is no easy way to plug in the files.list
data to it.