Scope API resources per user (shared + owned visibility, owner-or-admin edits)

Projects, agents, interaction, approvals, schedules, memory, commands,
and the Claude page resources (skills/connectors/plugins/models) now
resolve through the Actor's ownership rules: users see shared rows plus
their own, creates stamp the creating user as owner, mutations require
the owner or an admin, and invisible resources 404. Legacy env tokens
keep their exact historical semantics (all-access; admin token for the
old admin-gated routes). Commands from a user carry a user:<id> audit
label so they can track their own non-project commands.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019ws7xj5Ej623hh4GXQCYYR
This commit is contained in:
Claude
2026-08-12 19:24:22 +00:00
parent c227faa76d
commit 6555f1ad79
12 changed files with 506 additions and 222 deletions
+3 -1
View File
@@ -388,7 +388,9 @@ def test_skill_install_route_enqueues(client, auth, lowpriv):
assert r.status_code == 202
body = r.json()
assert body["type"] == "skill_install" and body["status"] == "queued"
assert body["payload"] == {"prompt": "Install x from y"}
# Env-token installs land as shared skills (owner_user_id None); a signed-in user's
# install would carry their id here.
assert body["payload"] == {"prompt": "Install x from y", "owner_user_id": None}
assert (
client.post("/claude/skills/install", json={"prompt": "x"}, headers=lowpriv).status_code