Skip to content

新建文档权限角色

标签文件权限角色

请求说明

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

路径参数 (Path)

属性名类型是否必填描述可选值
drive_id
stringdrive_id表示盘id,参考 drive.list_drives接口返回的data.items[?].id-

请求体(Body)

请求体格式: application/json

没有可用的数据

请求体示例

json
{
  "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
  }
}

响应体(Response)

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

没有可用的数据

响应体示例

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