Skip to content

feat(html-documents): require staff plus organization asset access - #226

Merged
MikeChenWM merged 1 commit into
mainfrom
cursor/html-docs-staff-metadata-dd48
Nov 18, 2026
Merged

MikeChenWM merged 1 commit into
mainfrom
cursor/html-docs-staff-metadata-dd48

Conversation

@MikeChenWM

Copy link
Copy Markdown
Contributor

Why

Mike asked HTML document management to be staff-only, the same as the admin UI (收束和 ui 一样), while keeping the existing organization asset checks. Museon-AI/museon#7541 (not merged) puts require_staff on every private HTML document route and leaves GET /api/v1/share/html/{token} and by-slug anonymous. That PR's vendored CLI catalog already marks the six private commands staff with staff_with_organization_asset_access. museon-cli owns contracts/command-catalog.json; until it says the same thing, the next pnpm agent-cli:contract:sync would overwrite that snapshot.

Changes

No version bump. Package version and contract_revision stay 3.0.0.

The six private commands (+upload, +list, +share, +unshare, folder +create, +install-defaults) keep organization_bound: true, agent_cli.access, and enforcement: museon_server. They now also set required_roles: ["staff"] and resource_policy: staff_with_organization_asset_access. CommandSpec already stores those as separate fields, so the organization boundary is not dropped.

The CLI does not enforce staff. A caller the CLI cannot tell is staff still sends X-Organization-Id; a non-staff denial is the server's 403. Public customer links are not a command and are unchanged. Other domains stay organization_member (or their existing role).

contracts/command-catalog.json is byte-identical to apps/api/app/contracts/agent_cli_command_catalog.json on museon#7541 (f39a076).

Tests

uv run ruff check .
uv run python scripts/gen_command_docs.py --check
uv run python scripts/gen_command_contract.py --check
uv run python scripts/gen_task_index.py --check
uv run pytest -q
1992 passed in 448.24s

Main-repo sync

  • Catalog SHA-256: 0b0050c1cc3766fad20ddd056612b00a90ffdfd883b0ff6a1314474679a44ae9
  • contract_revision: 3.0.0
  • After this PR is on museon-cli main, pnpm agent-cli:contract:sync should reproduce that file. Do not sync from current museon-cli main before that, or the staff metadata is wiped. No CLI release, tag, or deploy from here.
Open in Web Open in Cursor 

The six private management commands stay organization-bound. The catalog now
also requires staff; the server still enforces both, and public share reads
are unchanged.

Co-authored-by: Weimeng Chen <MikeChenWM@users.noreply.github.com>
@MikeChenWM
MikeChenWM merged commit 4947f9a into main Nov 18, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants