Drive Tool improvements
Currently the tool spends a lot of time and multiple batches of updates that just respond with a 404 as the permission was already removed from a parent folder (aka inherited permissions). Processing of the file/permissions result should be able to identify these and avoid the need to remove them.
It is possible to limit the files().list()
API operation by mimeType
to folders - https://developers.google.com/drive/api/guides/ref-search-terms.
Suggested flow:
- scan for all folders
- if any:
- save recovery doc
- remove folder permissions
- scan for all files
- if any:
- save/update recovery doc
- remove file permission
- update scan result and remove "scan" action, as appropriate
We are also going to have the potential for multiple scan recovery documents for a person if the process drops out midway. So the recovery action should attempt to merge all existing recovery docs to get a complete picture (may be a separate issue).
We also need to consider a (nightly?) process to clear recovery docs of (not recently) deleted accounts (starts in Sept) or accounts that have been unsuspended.