Get the shared permission list
| Properties | Values |
|---|---|
| HTTP methods | GET |
| Interface path | /nd/api/share/share_roles |
| Category | Share API |
Interface description
Returns sharing permission types for the entire system. When setting a sharing participant's role, use the selected role's roles[].id as role_id.
Interface path: /nd/api/share/share_roles
HTTP method: GET
HTTP method: GET
URL parameters
No endpoint-specific parameters. Authentication headers are still required as described below.
Return field description
The response contains a roles array of role objects. The following fields and JSON types are observed in the supplied non-empty sample; this does not establish that every field is required or always non-null.
| Field | Sample type | Description |
|---|---|---|
id |
int |
Role ID; used as role_id when setting a sharing participant's permissions. |
name |
string |
Role name; names can repeat and are not a substitute for IDs. |
description |
string |
Role description. |
permission |
int |
Permission value, not the role ID. Individual permission-bit definitions are not supplied; do not derive allowed actions from this value. |
forShare |
int |
Sharing-related flag; every value in this sample is 1. |
forTeamShare |
int |
Team-sharing-related flag; sample values are 0 or 1. |
forEnterprise |
int |
Enterprise-related flag; sample values are 0 or 1. |
roleOrder |
int |
Role-order field; sort direction is not specified. |
enterpriseId |
string |
Enterprise identifier; retain the string type even when it contains only digits. |
creator |
string or null |
Creator field; both value types occur in the sample. |
descriptionEN |
string |
English-description field; its actual content is not guaranteed to be English. |
nameEN |
string |
English-name field; its actual content is not guaranteed to be English. |
systemdefault |
int |
The sample contains 0, 1 and 2, not booleans. The business meaning of each value is not defined in the sample. |
Scroll horizontally to view all columns
The following retains the existing success-response envelope and shows one role from the sample, not the complete role list. Returned display strings are preserved as supplied:
{
"code": 0,
"roles": [
{
"id": 10,
"name": "批注评论",
"description": "可以批注评论",
"permission": 33,
"forShare": 1,
"forTeamShare": 1,
"forEnterprise": 1,
"roleOrder": 80,
"enterpriseId": "0",
"creator": null,
"descriptionEN": "Comment",
"nameEN": "Comment",
"systemdefault": 0
}
],
"success": true
}
For this sample, select role_id: 10, not permission: 33, an array index or the role name. Read IDs from the current response rather than hard-coding the example values as a universal role mapping. Handle same-name roles separately by ID.
The system role list does not establish that the current user can assign every listed role to any file. See Get the sharing roles the user can set for a specific file for file-specific choices.
Call instructions
- Before calling, you need to complete Get token or the corresponding login-free authentication, and carry
Authorization: Bearer <access_token>in the request header. - If there are differences in parameters and return fields due to deployment versions, the actual private cloud API documents and joint debugging results should prevail.
- Category: Sharing API.