permissions 可能完全不同,回调里要按 X-Shimo-Token 解出的 uid 区分计算。GET {endpoint_url}/users/current/info
Header: X-Shimo-Token: <前端传入的 token>{
"id": "userid123",
"name": "张三",
"avatar": "https://example.com/user-123.png",
"email": "user123@example.com",
"teamGuid": "team_001"
}X-Shimo-Token 解出的 uid 和接入方业务库里的人对不上,所有权限字段都没意义。GET {endpoint_url}/files/{fileId}
Header: X-Shimo-Token: <前端传入的 token>{
"id": "doc_38291",
"name": "Q3 战略规划",
"type": "documentPro",
"permissions": {
"readable": true,
"editable": true,
"commentable": true,
"copyable": true,
"exportable": true,
"manageable": false,
"copyablePasteClipboard": true,
"attachmentCopyable": true,
"cutable": true,
"attachmentPreviewable": true,
"attachmentDownloadable": true,
"imageDownloadable": true
},
"creatorId": "userid123",
"createdAt": "2026-04-01T08:00:00Z",
"updatedAt": "2026-04-02T09:30:00Z",
"teamGuid": "team_001"
}| 字段 | 必填 | 默认值 | 含义 | 影响 |
|---|---|---|---|---|
readable | 是 | — | 能否打开文档 | false 时编辑器拒绝加载 |
editable | 是 | — | 能否编辑正文 | false 时编辑器进入只读模式 |
commentable | 是 | — | 能否评论 / 回复 | 控制评论区开关 |
copyable | 是 | — | 能否复制文档内容 | false 时禁用复制 / 剪切 |
exportable | 是 | — | 能否导出文档 | 控制导出菜单 |
manageable | 是 | — | 是否为管理者 | 见下文管理者权限说明 |
copyablePasteClipboard | 否 | true | 能否把内容粘贴到文档外 | 只有 copyable: true 时才会生效 |
attachmentCopyable | 否 | true | 能否复制附件 | — |
cutable | 否 | true | 能否剪切内容 | — |
attachmentPreviewable | 否 | true | 能否预览附件 | — |
attachmentDownloadable | 否 | true | 能否下载附件 | — |
imageDownloadable | 否 | true | 能否下载图片 | — |
true,只在需要细粒度限制时显式返回 false。manageable: true 的影响范围(来自官方文档):true。true。true 才能导出锁定内容。manageable: true。editable = true 时 copyable 必须为 true(官方明确约束)。可以编辑就必然可以读到内容,禁止复制没有实际意义。readable = false 时其它字段全部应当为 false,没必要也不应该给"看不到的人"任何子权限。copyablePasteClipboard = true 前提是 copyable = true。否则石墨会忽略这个高级权限。manageable 与其它字段在逻辑上独立 —— 管理者不必然可读,可读者也不必然是管理者;但实践中"非可读用户却是管理者"几乎不会出现。| 角色 / 状态 | readable | editable | commentable | copyable | exportable | manageable |
|---|---|---|---|---|---|---|
| 文档所有者 / 管理员 | true | true | true | true | true | true |
| 普通编辑者 | true | true | true | true | true | false |
| 评论者(只读 + 评论) | true | false | true | true | true | false |
| 只读用户 | true | false | false | true | true | false |
| 无权访问 / 被拒绝 | false | false | false | false | false | false |
readable: true, editable: false, copyable: false, exportable: false, copyablePasteClipboard: false。creatorId 不要写成"当前登录用户",应该写文件的真正创建者,否则换人打开后 manageable 行为会乱。