Я рекомендую следовать Googles quickstart , тогда вы сможете использовать следующий код.
от ошибок импорта apiclient # ...
def update_permission(service, file_id, permission_id, new_role):
"""Update a permission's role.
Args:
service: Drive API service instance.
file_id: ID of the file to update permission for.
permission_id: ID of the permission to update.
new_role: The value 'owner', 'writer' or 'reader'.
Returns:
The updated permission if successful, None otherwise.
"""
try:
# First retrieve the permission from the API.
permission = service.permissions().get(
fileId=file_id, permissionId=permission_id).execute()
permission['role'] = new_role
return service.permissions().update(
fileId=file_id, permissionId=permission_id, body=permission).execute()
except errors.HttpError, error:
print 'An error occurred: %s' % error
return None