Get workspace permisions
Get the current user's access to the projects and tables in the specified workspace.
Request
curl -vvv "$API_HOST/open/api/v1/workspaces/$type/$id/roles/" -H "Authorization: $access-token"
Python example
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()
Response
Response body
Name | Type | Description |
---|---|---|
detail | array | Permision list |
∟ id | int64 | Node ID |
∟ type | string | Node type: project, table, org, datafile |
∟ role | string | Permission: admin editable readonly |
Response body example
{
"code": 0,
"detail": [
{
"id": 56,
"type": "project",
"role": "admin"
},
{
"id": 55,
"type": "project",
"role": "admin"
}
],
"extra":null,
"message": "OK",
"requestID":null
}