Skip to content

docs(drive): add guide for granting document permission to current bot#414

Merged
fangshuyu-768 merged 1 commit intomainfrom
chore/permission
Apr 11, 2026
Merged

docs(drive): add guide for granting document permission to current bot#414
fangshuyu-768 merged 1 commit intomainfrom
chore/permission

Conversation

@caojie0621
Copy link
Copy Markdown
Collaborator

@caojie0621 caojie0621 commented Apr 11, 2026

Summary

Add skill guidance for granting document permission to the current bot application via bot info API + permission.members.create.

Changes

  • skill-template/domains/drive.md — append "授权当前应用访问文档" section with step-by-step instructions
  • skills/lark-drive/SKILL.md — same section synced

Test Plan

  • Documentation only, no code changes

Related Issues

  • None

Summary by CodeRabbit

  • Documentation
    • Added instructions for authorizing the current application to access documents, including API call procedures and required parameters
    • Included guidance on applicable scenarios and available resource type options

@github-actions github-actions bot added the size/M Single-domain feat or fix with limited business impact label Apr 11, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9944b467-285b-48ef-878c-0e38c6d38bd3

📥 Commits

Reviewing files that changed from the base of the PR and between 9f81e7e and 742208c.

📒 Files selected for processing (2)
  • skill-template/domains/drive.md
  • skills/lark-drive/SKILL.md

📝 Walkthrough

Walkthrough

Two documentation files are updated to add a new section explaining how to grant document access permissions to the current bot/app itself, including the specific API calls and parameters required (bot.open_id, member_type=openid, perm=view).

Changes

Cohort / File(s) Summary
Documentation - Drive Authorization
skill-template/domains/drive.md, skills/lark-drive/SKILL.md
Added new section documenting the workflow to grant the current bot application access to Lark Drive documents, including instructions to retrieve bot.open_id via API and create member permissions with appropriate resource type enumeration.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested labels

domain/ccm

Suggested reviewers

  • fangshuyu-768

Poem

🐰 A curious bunny hops through docs so fine,
Teaching bots to access drives divine,
With open_ids and permissions bright,
The bot's own files now held just right! 📋✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding documentation guidance for granting document permissions to the current bot application.
Description check ✅ Passed The pull request description follows the required template with complete Summary, Changes, Test Plan, and Related Issues sections, all appropriately filled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/permission

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@742208c6bca6a51986a3ad424798dc2fed62148a

🧩 Skill update

npx skills add larksuite/cli#chore/permission -y -g

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 11, 2026

Greptile Summary

This PR appends a new "授权当前应用访问文档" section to both skill-template/domains/drive.md and skills/lark-drive/SKILL.md, providing a two-step guide for granting a document permission to the current bot by first fetching the bot's open_id via /open-apis/bot/v3/info and then calling permission.members.create.

  • The example command hardcodes \"perm\":\"view\" (read-only), but most operations performed by this skill — adding comments, uploading, modifying content — require at minimum \"perm\":\"edit\". A developer who follows the guide as-is will find their bot can still not write to the document.

Confidence Score: 4/5

Safe to merge after fixing the perm level; the hardcoded "view" will silently break write operations for developers following this guide.

There is one P1 finding: the example grants only perm:"view" (read-only) while the skill is primarily used for write operations such as adding comments and uploading files. A developer following the guide will end up with a bot that still cannot perform the actions that prompted them to grant permission in the first place. The fix is a one-word change in both files.

Both skill-template/domains/drive.md (line 169) and skills/lark-drive/SKILL.md (line 182) need the perm value corrected.

Important Files Changed

Filename Overview
skill-template/domains/drive.md New "授权当前应用访问文档" section added; the example hardcodes perm: "view" which is read-only and will cause failures for the write operations this skill is primarily used for.
skills/lark-drive/SKILL.md Same new section synced from the template; carries the identical perm: "view" issue.

Sequence Diagram

sequenceDiagram
    participant Agent as AI Agent (bot)
    participant BotAPI as /open-apis/bot/v3/info
    participant PermAPI as drive permission.members.create

    Agent->>BotAPI: GET /open-apis/bot/v3/info --as bot
    BotAPI-->>Agent: { bot: { open_id: "ou_xxx" } }
    Agent->>PermAPI: POST permission.members.create
    Note over Agent,PermAPI: --data {member_type:openid, member_id:ou_xxx, perm:view}
    PermAPI-->>Agent: 200 OK (read-only access granted)
    Note over Agent,PermAPI: ⚠️ perm:view blocks subsequent write ops
Loading

Reviews (1): Last reviewed commit: "docs(drive): add guide for granting docu..." | Re-trigger Greptile

@fangshuyu-768 fangshuyu-768 merged commit 368ec7e into main Apr 11, 2026
12 checks passed
@fangshuyu-768 fangshuyu-768 deleted the chore/permission branch April 11, 2026 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants