新建权限角色
适用版本>=v7.0.2308b.20230824
接口说明:新建权限角色
请求说明
| 请求地址 | 配置域名+/graph+/v7/drives/{drive_id}/roles/create |
|---|---|
| 请求方法 | POST |
| 签名方式 | WPS-4签名/WPS-4-GM签名(配置域名+/graph不参与签名) |
| 权限要求 | 更新文件角色权限(用户授权) kso.drive.role.write 应用管理文档权限角色(应用授权) kso.appdrive.role.write |
请求头(Header)
| 名称 | 是否必填 | 说明 |
|---|---|---|
| Content-Type | 是 | 固定为: application/json |
| Wps-Docs-Date | 是 | 取当前时间, 示例: Wed, 23 Jan 2013 06:43:08 GMT |
| Wps-Docs-Authorization | 是 | 计算方法参考签名说明 |
| Authorization | 是 | 授权凭证,格式为: Bearer {access_token} |
路径参数(Path)
| 名称 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| drive_id | string | 是 | 驱动盘id,<= 1024 characters |
请求体(Body)
| 名称 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| name | string | 是 | 角色名称,不支持"/:*?"<>|"特殊符号和emoji表情,长度范围[1,255] |
| permissions | object | 否 | 权限(待废弃,推荐使用permission_bits) |
| ∟ comment | bool | 是 | 评论 |
| ∟ copy | bool | 是 | 复制 |
| ∟ copy_content | bool | 是 | 复制内容 |
| ∟ delete | bool | 是 | 删除 |
| ∟ download | bool | 是 | 下载 |
| ∟ list | bool | 是 | 列表 |
| ∟ move | bool | 是 | 移动 |
| ∟ new_empty | bool | 是 | 新建 |
| ∟ perm_ctl | bool | 是 | 权限控制 |
| ∟ preview | bool | 是 | 预览 |
| bool | 是 | 打印 | |
| ∟ rename | bool | 是 | 重命名 |
| ∟ share | bool | 是 | 分享 |
| ∟ update | bool | 是 | 更新 |
| ∟ upload | bool | 是 | 上传 |
| permission_bits | object | 否 | 权限(permission_bits和permissions参数至少需要传一个,推荐使用permission_bits) |
| ∟ comment | bool | 是 | 评论 |
| ∟ copy | bool | 是 | 复制 |
| ∟ copy_content | bool | 是 | 复制内容 |
| ∟ delete | bool | 是 | 删除 |
| ∟ download | bool | 是 | 下载 |
| ∟ list | bool | 是 | 列表 |
| ∟ move | bool | 是 | 移动 |
| ∟ new_empty | bool | 是 | 新建 |
| ∟ perm_ctl | bool | 是 | 权限控制 |
| ∟ preview | bool | 是 | 预览 |
| bool | 是 | 打印 | |
| ∟ rename | bool | 是 | 重命名 |
| ∟ share | bool | 是 | 分享 |
| ∟ update | bool | 是 | 更新 |
| ∟ upload | bool | 是 | 上传 |
| type | string | 是 | 角色类型,Enum: “custom” |
请求体示例
{
"name": "string",
"permissions": {
"comment": true,
"copy": true,
"copy_content": true,
"delete": true,
"download": true,
"list": true,
"move": true,
"new_empty": true,
"perm_ctl": true,
"preview": true,
"print": true,
"rename": true,
"share": true,
"update": true,
"upload": true
},
"permission_bits": {
"comment": true,
"copy": true,
"copy_content": true,
"delete": true,
"download": true,
"list": true,
"move": true,
"new_empty": true,
"perm_ctl": true,
"preview": true,
"print": true,
"rename": true,
"share": true,
"update": true,
"upload": true
},
"type": "custom"
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
响应体(Response)
| 名称 | 类型 | 说明 |
|---|---|---|
| code | integer | code |
| detail | string | detail |
| msg | string | msg |
| data | object | |
| ∟ id | string | 角色id,<= 1024 characters |
| ∟ name | string | 角色名称,<= 1024 characters |
| ∟ permission_bits | object | 权限 |
| ∟ ∟ list | bool | 列表 |
| ∟ ∟ preview | bool | 预览 |
| ∟ ∟ rename | bool | 重命名 |
| ∟ ∟ share | bool | 分享 |
| ∟ ∟ move | bool | 移动 |
| ∟ ∟ delete | bool | 删除 |
| ∟ ∟ perm_ctl | bool | 权限控制 |
| ∟ ∟ copy_content | bool | 复制内容 |
| bool | 打印 | |
| ∟ ∟ download | bool | 下载 |
| ∟ ∟ copy | bool | 复制 |
| ∟ ∟ comment | bool | 评论 |
| ∟ ∟ update | bool | 更新 |
| ∟ ∟ new_empty | bool | 新建 |
| ∟ ∟ upload | bool | 上传 |
| ∟ type | string | Enum: “custom” 角色类型 |
响应体示例
{
"data": {
"id": "string",
"name": "string",
"permission_bits": {
"comment": true,
"copy": true,
"copy_content": true,
"delete": true,
"download": true,
"history": true,
"list": true,
"move": true,
"new_empty": true,
"perm_ctl": true,
"preview": true,
"print": true,
"rename": true,
"saveas": true,
"secret": true,
"share": true,
"update": true,
"upload": true,
"view": true
},
"type": "custom"
},
"code": 0,
"detail": "string",
"msg": "string"
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31