Skip to content

新建权限角色

适用版本>=v7.0.2410as.20241017

接口说明:新建权限角色

标签文件权限角色

请求说明

字段
请求地址
配置域名+/openapi+/v7/drives/{drive_id}/roles/create
HTTP 方法
POST
接口描述
新增一个权限角色,角色定义成功后可以用来做文件授权。文件权限角色指包含一些文件操作权限的集合,常见的可编辑/可查看/可评论等都是权限角色。允许在Drive下自定义权限角色
签名方式
KSO-1(配置域名+/openapi不参与签名)
限频策略
权限要求
查询和管理文件权限(应用授权) kso.file_permission.readwrite
查询和管理文件权限(用户授权) kso.file_permission.readwrite

请求头 (Headers)

属性名类型是否必填描述可选值
X-Kso-Date
stringRFC1123 格式的日期,例: Wed, 23 Jan 2013 06:43:08 GMT-
X-Kso-Authorization
stringKSO-1 签名值,详见《签名方法》-
Authorization
string授权凭证,格式为:Bearer {access_token}-

路径参数 (Path)

属性名类型是否必填描述可选值
drive_id
string驱动盘id,<= 1024 characters-

请求体(Body)

请求体格式: application/json

没有可用的数据

请求体示例

json
{
  "name": "string",
  "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
  }
}

响应体(Response)

HTTP状态码: 200
响应体格式: application/json

没有可用的数据

响应体示例

json
{
  "data": {
    "id": "string",
    "name": "string",
    "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": "preset"
  },
  "code": 0,
  "msg": "string"
}