Skip to content

scope read endpoints to project membership/admins - #301

Open
shreeyaadhikari wants to merge 2 commits into
mainfrom
ownership-membership-check
Open

scope read endpoints to project membership/admins#301
shreeyaadhikari wants to merge 2 commits into
mainfrom
ownership-membership-check

Conversation

@shreeyaadhikari

@shreeyaadhikari shreeyaadhikari commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

ℹ️ Issue

Closes #246

📝 Description

Add membership + admin scoping to read endpoints so authenticated non-admins only see rows for projects they belong to; admins keep full visibility. Also fixed TypeScript/runtime issues found while applying scoping and updated tests to match the new security behavior.

Briefly list the changes made to the code:

  • Added membership/admin scoping to read endpoints: donors/handler.ts for GET /donors, GET /donations
  • enforce project-membership checks for GET /expenditures in expenditures/handler.ts
  • reports/handler.ts: scope GET /reports.
  • Tests: Updated expectations to reflect scoped results for non-admin users in donors.test.ts

✔️ Verification

Ran the test suite locally to verify the changes and updated the tests so they now expect the new project-scoped results for non-admin users.

image image

@shreeyaadhikari shreeyaadhikari self-assigned this Jul 30, 2026
@shreeyaadhikari
shreeyaadhikari marked this pull request as ready for review July 31, 2026 00:17
@github-actions
github-actions Bot requested a review from Rayna-Yu July 31, 2026 00:17
github-actions Bot added a commit that referenced this pull request Jul 31, 2026
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.

[Security] List endpoints leak data across users (no ownership/membership check)

1 participant