Google Drive: Remove share link
planned
Stockholms Kvinnohistoriska
Currently, it is possible to turn on sharing for a Google Drive file using the Google Drive module + Get a Share Link action. It would be nice to be able to remove sharing from a file as well.
Perhaps adding Role:"no-one" or Type:"No access".
Log In
Hai Anh Leová
planned
Ram Freedman
Hi,
Let me try and add more information to this request.
We need a way to scan our google drive and search for files or folders that in now shared with a certain email address and to be able to change the current permission to any of the different roles: writer / owner / reader / commenter and most importantly to remove any such role so the relevant email address will not have access to this folder or file at all.
In order to do this we should use the list files HTTP request and add the relevant ?fields to it like so:
GET https://www.googleapis.com/drive/v3/files?fields=files(id,name,description,mimeType,parents,trashed,permissions)
We need to be able to run this GET command on a specific email address so we will be able to get the results that are relevant to this email address and not the whole drive with file and folders that are not shared with this email address.
Such a search should be done across all of the google drive folders and files and not just the first 100 or something like that.
From the above get request we need to get the
fileId
of each relevant file and folder and the permissionId
that associated with the relevant email address we want to remove access from. After getting the above information we need to do the actual delete permissions request with this command:
DELETE https://www.googleapis.com/drive/v3/files/fileId/permissions/permissionId
Please note and take care that sometimes when removing the permission from a folder - the permissions will be removed from all the files and subfolders that nested within the parent folder. doing so will result with an error:
[404] Permission not found
So there have to be a way to remove from the parent folder first and then to recheck again the permissions on any subfolders and then to remove the permissions from such subfolders and check the permissions again - this time on the files and only then to remove the permissions from the files. Also - we need to be able to do so on folders / files that we are not the owner on.
Also - we need to be able to do change the files permission from
Anyone can view
to Limited
etc.To sum it all up we need a way to search the entire google drive for folders and files that are currently shared with a specific email address and to be able to change the role of such email address - most importantly to be able to completely remove it so any access such an email address had to the folder / file will be removed.
Reference:
Thanks!
Ram
By the way - if you think that this is a separate feature request I can open a new one.