Repository navigation
fix(organization): evaluate project roles against the project in the path - #14787
Conversation
…path Organization project routes take the target project from the path, but project-specific console roles were matched against the context project, so a role on one project counted for sibling projects. Bind the request to the path project, grant project-specific roles only for that project, and keep authorization on for organization project reads so lists and gets return only projects the member can access. Co-Authored-By: Claude <[email protected]>
|
Review complete. No blocking issues — approved ✅; 1 nitpick below. 🧹 Nitpicks (1) — 🟢 1 low
This PR teaches the shared API authorization hook and the project-ID resolution resource to recognize the
Reviewed commit: 1305bae |
🟢 Tier S · Ready to mergeOrganization project requests now resolve project-specific roles from the project ID in the route, while organization-level project operations continue to require team-wide roles. The project resolver avoids treating these routes as deprecated aliases, and organization project reads use database authorization to filter projects by access.
📂 Walkthrough · 3
Reviewed |
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
…ling project Co-Authored-By: Claude <[email protected]>
Security rulesNo new WARNING or ERROR findings from security rules. 6 existing findings tracked in
|
… (backport #14787) Organization project routes now grant project-specific roles only for the project named in the path, and organization-level routes grant only team-wide roles. Organization project reads keep database authorization on. 1.9 has no projectIdFromPath resource, so the path project is read from the URI inline; the organization key routes do not exist on 1.9 and their test calls are dropped. (cherry picked from commit 3f79291)
… (backport #14787) Organization project routes now grant project-specific roles only for the project named in the path, and organization-level routes grant only team-wide roles. Organization project reads keep database authorization on. 1.9 has no projectIdFromPath resource, so the path project is read from the URI inline; the organization key routes do not exist on 1.9 and their test calls are dropped. (cherry picked from commit 3f79291)
…ect-roles fix(organization): evaluate project roles against the project in the path (cherry picked from commit 3f79291)
Summary
Console members can hold roles limited to one project (
project-<id>-owner,project-<id>-developer). Organization project routes (/v1/organization/projects/:projectId/...) now grant those roles only for the project named in the path, so a member restricted to one project can manage that project and no other project in the organization.Changes
projectIdFromPathalso recognises/v1/organization/projects/:projectId, so the shared API hook binds the request's project header and context project to the path project, as it already does for/v1/projects/:projectId. The deprecated-alias project resolution ignores organization routes.GET /v1/organization/projectsandGET /v1/organization/projects/:projectIdkeep database authorization on, like/v1/projects, so a member only lists and reads projects they have access to.Tests
ProjectsConsoleClientTest::testProjectSpecificPermissionsForOrganizationProjects: a member withproject-A-developercan create keys for, read and update project A through both the console project (withx-appwrite-organization) and admin mode on A, and gets 401 on key create/list, update, delete and project create for sibling project B, a non-200 on reading B, and a project list without B. E2E is verified by CI.Related: appwrite-labs/cloud#6666