Can someone please tell me if it is possible to do the following, and if so, point me in the right direction please:
TLDR: When I share the folder to a specific "user" as a "reader" I don't want link sharing to be turned on but it is. "Anyone at My_Org who has the link can view"
I have dug through the docs and posts and cannot find how to do it.
Code Below.
I am creating folders with:
def createFolder(name,sharewith):
file_metadata = {
'name': name,
'parents': ['----------------------------------------'],
'mimeType': 'application/vnd.google-apps.folder'
}
file = service.files().create(body=file_metadata,
fields='id').execute()
fid = file.get('id')
return fid
Then Sharing the folder with a specific individual:
def insert_permission(service, file_id, emailAddress, perm_type, role, notif):
new_permission = {
'emailAddress': emailAddress,
'type': perm_type,
'role': role
}
try:
return service.permissions().create(
fileId=file_id,
body=new_permission,sendNotificationEmail=notif).execute()
except errors.HttpError as error:
print('An error occurred: %s' % error)
return None
Edit: I see this - newPermission.setType("anyone"); in Set file sharing level to 'Anyone with the link' through Google Drive API
I want to do the opposite but can't find the acceptable parameters for setType()