Filter project documents before tabular generation
From the PR description
Summary
- filter fallback project documents through
filterAccessibleDocumentIdsbefore tabular generation - prevent directly shared reviews from expanding into private project document access
Why
POST /tabular-review/:reviewId/generate allows access through ensureReviewAccess, including direct shared_with review sharing. When a linked project review has no existing cells, the route falls back to loading every document in review.project_id without checking whether the requester can access those documents. A user who can access only the review could therefore trigger extraction over private project documents.
Test
npm run build --prefix backend
Our analysis
Enforce document access checks on tabular review fallback — read the full analysis →
Think the analysis missed something the PR description covers?
Capture this PR into my fork
Download a Markdown prompt that tells Claude how to port every
commit in this PR into your working tree. Run it via
claude -p < capture-pull-177.md from
inside the repo you want the changes in.