feat(permissions): round out basic-usage for normal members#3654
Merged
Conversation
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>
Contributor
🧪 BenchmarkShould we run the Virtual MCP strategy benchmark for this PR? React with 👍 to run the benchmark.
Benchmark will run on the next push after you react. |
Contributor
Release OptionsSuggested: Minor ( React with an emoji to override the release type:
Current version:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prerequisite for the planned capstone of removing
"user"from theBUILTIN_ROLESbypass. Today the built-inuserrole bypasses all permission checks, so UI gating only truly bites custom roles. Onceuseris 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-usagecapability.Added tools
ORGANIZATION_SETTINGS_GETreadOnlyHint; UI config only (sidebar, plugins, model tiers) — no secretsUSER_GETreadOnlyHint; handler scopes to shared-org members; returns public profileLINK_CURRENT_GETBRAND_CONTEXT_LISTAI_PROVIDER_TOPUP_URLFILE_OBJECTS_LISTVerified 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
basic-usagecapability, no role-backfill migration (seeBASIC_USAGE_TOOLSdocs inregistry-metadata.ts).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-usagepermissions to include essential read-only tools normal members use, so enforcing the built-inuserrole won’t break core flows. Covers app shell boot, chat branding and credits, file picker, and user display info.New Features
Migration
apps/mesh/src/tools/registry-metadata.ts.userrole enforcement flip will be a follow-up.Written for commit b77e0f4. Summary will update on new commits.