Skip to content

新建权限角色

适用版本>=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_idstring驱动盘id,<= 1024 characters

请求体(Body)

名称类型是否必填说明
namestring角色名称,不支持"/:*?"<>|"特殊符号和emoji表情,长度范围[1,255]
permissionsobject权限(待废弃,推荐使用permission_bits)
commentbool评论
copybool复制
copy_contentbool复制内容
deletebool删除
downloadbool下载
listbool列表
movebool移动
new_emptybool新建
perm_ctlbool权限控制
previewbool预览
printbool打印
renamebool重命名
sharebool分享
updatebool更新
uploadbool上传
permission_bitsobject权限(permission_bits和permissions参数至少需要传一个,推荐使用permission_bits)
commentbool评论
copybool复制
copy_contentbool复制内容
deletebool删除
downloadbool下载
listbool列表
movebool移动
new_emptybool新建
perm_ctlbool权限控制
previewbool预览
printbool打印
renamebool重命名
sharebool分享
updatebool更新
uploadbool上传
typestring角色类型,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"
}

响应体(Response)

名称类型说明
codeintegercode
detailstringdetail
msgstringmsg
dataobject
idstring角色id,<= 1024 characters
namestring角色名称,<= 1024 characters
permission_bitsobject权限
listbool列表
previewbool预览
renamebool重命名
sharebool分享
movebool移动
deletebool删除
perm_ctlbool权限控制
copy_contentbool复制内容
printbool打印
downloadbool下载
copybool复制
commentbool评论
updatebool更新
new_emptybool新建
uploadbool上传
typestringEnum: “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"
}