获取工作区权限
使用该接口可以获取当前用户对指定工作区下的项目和表的权限
请求
curl -vvv "$API_HOST/open/api/v1/workspaces/$type/$id/roles/" -H "Authorization: $access-token"
Python 示例
def get_workspace_role(access_token, workspace):
url = '%s/open/api/v1/workspaces/%s/%d/roles/' % (API_HOST, workspace['type'], workspace['id'])
headers = {'Authorization': access_token}
req = requests.get(url, headers=headers)
return req.json()
响应
响应体
名称 | 类型 | 描述 |
---|---|---|
detail | array | 权限列表 |
∟ id | int64 | 节点ID |
∟ type | string | 节点类型:project table org datafile |
∟ role | string | 权限: admin editable readonly |
响应体示例
{
"code": 0,
"detail": [
{
"id": 56,
"type": "project",
"role": "admin"
},
{
"id": 55,
"type": "project",
"role": "admin"
}
],
"extra":null,
"message": "OK",
"requestID":null
}