Agentic-feishu feishu-perm
飞书文档权限管理。用于添加/移除协作者、设置公开分享、检查访问级别。当用户提到分享(分享/共享)、权限、协作者、访问控制、链接分享、「把文档分享给XX」时触发。注意:创建/编辑文档内容用 feishu-doc。
install
source · Clone the upstream repo
git clone https://github.com/MidnightV1/agentic-feishu
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/MidnightV1/agentic-feishu "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/feishu_perm" ~/.claude/skills/midnightv1-agentic-feishu-feishu-perm && rm -rf "$T"
manifest:
skills/feishu_perm/SKILL.mdsource content
Feishu Permission Manager
管理文档/文件权限——添加协作者、设置公开链接分享、查看访问级别。
边界:feishu-perm 管理"谁能访问",feishu-doc 管理文档内容本身。转移所有权走 feishu-doc 的
transfer_owner。
CLI 调用方式
cd ~/Agent\ Space/agentic-feishu && python3 tools/builtin/skill_perm.py <action> --params '<json>'
示例:
python3 tools/builtin/skill_perm.py list --params '{"doc_token": "xxx"}'
Actions
调用方式:
python3 tools/builtin/skill_perm.py <action> --params '<json>'
| Action | 说明 | 必填参数 | 可选参数(含默认值) |
|---|---|---|---|
| 列出文档所有协作者及权限级别 | | |
| 获取当前公开分享设置 | | |
| 添加协作者 | , | , , |
| 移除协作者(不可逆) | , | , |
| 设置链接分享模式 | | , |
Permission Levels (perm
)
perm| 值 | 说明 |
|---|---|
| 只读 |
| 可编辑 |
| 可评论 |
| 完全控制(可管理权限) |
Doc Types (doc_type
)
doc_type有效值:
docx、sheet、bitable、folder、file、mindnote、slides、wiki
doc_type 必须与文档实际类型匹配,否则 API 返回错误。
Member Types (member_type
)
member_type| 值 | 说明 |
|---|---|
(默认) | 用户 open_id |
| 用户 user_id |
| 群组 ID |
| 部门 ID |
member_type 决定 member_id 的解释方式,必须与实际 ID 类型一致。
Link Sharing Options (link_share_entity
)
link_share_entity| 值 | 说明 |
|---|---|
| 组织内可查看(默认) |
| 组织内可编辑 |
| 链接可查看 |
| 链接可编辑 |
| 仅协作者可访问 |
Coded Behaviors
- 枚举校验:
、perm
、member_type
、doc_type
传入无效值时抛出link_share_entity
,message 说明有效值列表。ValueError
影响member_type
的解释方式,两者必须一致。member_id
必须与文档实际类型匹配。doc_type- Bot 需要
和drive:permission
scope。drive:permission:readonly
Examples
feishu_perm("list", {"doc_token": "xxx", "doc_type": "docx"}) feishu_perm("add", {"doc_token": "xxx", "member_id": "ou_yyy", "perm": "edit", "doc_type": "docx"}) feishu_perm("remove", {"doc_token": "xxx", "member_id": "ou_yyy"}) feishu_perm("set_sharing", {"doc_token": "xxx", "link_share_entity": "anyone_readable", "doc_type": "sheet"})