def delete_permission(server, auth_token, site_id, workbook_id, user_id, permission_name, existing_mode):
"""
Deletes a specific permission from the workbook.
'server' specified server address
'auth_token' authentication token that grants user access to API calls
'site_id' ID of the site that the user is signed into
'workbook_id' ID of workbook to audit permission in
'user_id' ID of the user to audit
'permission_name' name of permission to add or update
'existing_mode' is the mode of the permission already set for the workbook
"""
url = server + "/api/{0}/sites/{1}/workbooks/{2}/permissions/users/{3}/{4}/{5}".format(VERSION,
site_id,
workbook_id,
user_id,
permission_name,
existing_mode)
server_response = requests.delete(url, headers={'x-tableau-auth': auth_token})
_check_status(server_response, 204)
return
评论列表
文章目录