Skip to content

feat(permissions): round out basic-usage for normal members#3654

Merged
viktormarinho merged 1 commit into
mainfrom
feat/basic-usage-round-out
Jun 2, 2026
Merged

feat(permissions): round out basic-usage for normal members#3654
viktormarinho merged 1 commit into
mainfrom
feat/basic-usage-round-out

Conversation

@viktormarinho
Copy link
Copy Markdown
Contributor

@viktormarinho viktormarinho commented Jun 2, 2026

Summary

Prerequisite for the planned capstone of removing "user" from the BUILTIN_ROLES bypass. Today the built-in user role bypasses all permission checks, so UI gating only truly bites custom roles. Once user is enforced, a normal member gets only basic-usage server-side — so basic-usage must cover everything a non-admin legitimately does first.

I traced every non-admin flow (chat, app-shell boot, viewing agents/connections, inbox, tasks, profile/preferences, global search, file picker, credits banner) to its MCP tool calls and found read/essential tools that work today only via the user-role bypass. This adds them to the basic-usage capability.

Added tools

Tool Flow Why safe
ORGANIZATION_SETTINGS_GET App-shell boot (Suspense) + home readOnlyHint; UI config only (sidebar, plugins, model tiers) — no secrets
USER_GET "Created by" on agent/automation detail readOnlyHint; handler scopes to shared-org members; returns public profile
LINK_CURRENT_GET Header desktop indicator (polled), home, chat Read; caller's own link status
BRAND_CONTEXT_LIST Chat no-provider empty state branding Read; org branding, no secrets
AI_PROVIDER_TOPUP_URL Chat credits-exhausted banner "Top up" Returns a checkout URL; lets any member self-serve credits
FILE_OBJECTS_LIST File picker in sandbox/content editor Lists object keys only — no credentials

Verified each tool's read-only-ness / output schema before adding. Write/management tools (CREATE/UPDATE/DELETE, provisioning, member/tag management, monitoring) were confirmed to be called only by gated admin UI and were left gated.

Notes

  • Runtime-grant model: one-line edit to the basic-usage capability, no role-backfill migration (see BASIC_USAGE_TOOLS docs in registry-metadata.ts).
  • The user-role enforcement flip itself is a separate follow-up — not in this PR.

Testing

  • bun run check
  • bun run lint ✅ (0 warnings, 0 errors)
  • bun run knip ✅ (no findings)
  • bun run fmt

No test added: per TESTING.md this is a one-line declarative capability change with no logic to unit-test, and adding a brittle snapshot of the set would not be meaningful.

🤖 Generated with Claude Code


Summary by cubic

Expands basic-usage permissions to include essential read-only tools normal members use, so enforcing the built-in user role won’t break core flows. Covers app shell boot, chat branding and credits, file picker, and user display info.

  • New Features

    • ORGANIZATION_SETTINGS_GET — app shell config; read-only.
    • USER_GET — member display info; org-scoped; read-only.
    • LINK_CURRENT_GET — your desktop link status; read-only.
    • BRAND_CONTEXT_LIST — org branding for chat empty state; read-only.
    • AI_PROVIDER_TOPUP_URL — checkout URL for self-serve credits.
    • FILE_OBJECTS_LIST — list object keys for the file picker; no secrets.
  • Migration

    • No data migration; runtime capability update in apps/mesh/src/tools/registry-metadata.ts.
    • Admin write/manage tools remain gated. The user role enforcement flip will be a follow-up.

Written for commit b77e0f4. Summary will update on new commits.

Review in cubic

Audit of every non-admin member flow (app-shell boot, chat, viewing
agents/connections, file picker, credits banner) surfaced read/essential
tools reachable today only via the built-in `user` role bypass. Add them
to the basic-usage capability so the planned `user` enforcement flip
doesn't break normal members:

- ORGANIZATION_SETTINGS_GET — loaded via Suspense on every member's first
  paint (sidebar, plugins, model tiers); read-only, no secrets.
- USER_GET — resolves member display ("created by"); shared-org scoped.
- LINK_CURRENT_GET — caller's own desktop-link status (header poll).
- BRAND_CONTEXT_LIST — org branding for the chat empty state.
- AI_PROVIDER_TOPUP_URL — checkout link in the chat credits banner.
- FILE_OBJECTS_LIST — file picker in the sandbox/content editor.

Runtime-grant model: one-line edit, no role-backfill migration.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

🧪 Benchmark

Should we run the Virtual MCP strategy benchmark for this PR?

React with 👍 to run the benchmark.

Reaction Action
👍 Run quick benchmark (10 & 128 tools)

Benchmark will run on the next push after you react.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

Release Options

Suggested: Minor (2.386.0) — based on feat: prefix

React with an emoji to override the release type:

Reaction Type Next Version
👍 Prerelease 2.385.3-alpha.1
🎉 Patch 2.385.3
❤️ Minor 2.386.0
🚀 Major 3.0.0

Current version: 2.385.2

Note: If multiple reactions exist, the smallest bump wins. If no reactions, the suggested bump is used (default: patch).

@viktormarinho viktormarinho enabled auto-merge (squash) June 2, 2026 19:30
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

@viktormarinho viktormarinho merged commit 24125a4 into main Jun 2, 2026
19 checks passed
@viktormarinho viktormarinho deleted the feat/basic-usage-round-out branch June 2, 2026 19:34
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.

1 participant