#550 Show A Reviewer An Applicant's Other Applications - #591
Open
b-at-neu wants to merge 2 commits into
Open
Conversation
Adds getApplicantOtherApplications, the app's first intentional cross-scope read: it authorizes the caller against the anchor application first, then deliberately drops position-manager scoping to surface all of that applicant's other applications platform-wide. Documents the disclosure as policy in PERMISSIONS.md rather than a deviation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
b-at-neu
commented
Aug 24, 2026
b-at-neu
left a comment
Collaborator
Author
There was a problem hiding this comment.
Code Review — Cycle 1 · needs revision
1 open — 1 🟡 Low (see inline)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
Author
Revision — Cycle 1fixed R1-L1 · 5d83f53 |
b-at-neu
commented
Aug 24, 2026
b-at-neu
left a comment
Collaborator
Author
There was a problem hiding this comment.
Code Review — Cycle 2 · approved
0 open — clean
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.
Closes #550
Summary
/applications/[id]so a reviewer can see whether the applicant has applied elsewhere — including on positions the reviewer doesn't manage.getApplicantOtherApplicationsauthorizes the caller against the application being viewed first, then intentionally drops position-manager scoping for the second query. Documented as policy inPERMISSIONS.md, not a deviation.Changes
prisma/data/applications.ts— newgetApplicantOtherApplications(applicationId, user). Step 1 authorizes the caller against the anchor application with the untouchedbuildApplicationWhere(user, 'listable'); step 2 fetches the same applicant's other applications withPUBLISHED_POSITION_WHERE(notbuildReviewablePositionWhere), then filters withisPositionActivein JS, matchinggetManagedPositions's pattern.lib/types.ts— newApplicantOtherApplicationrow type.lib/utils.ts— new purecanReviewPosition(user, managerIds), the unit-testable half of the row-level link-eligibility rule.components/features/applicant-other-applications.tsx— new server component rendering the section, its rows, and the empty state.app/(main)/(auth)/applications/[id]/page.tsx— mounts the section in its own<Suspense>boundary below the existing answer cards, outside the page'sPromise.allso the answers paint first.app/(main)/(auth)/applications/[id]/loading.tsx— matching skeleton.docs/PERMISSIONS.md— new "Cross-scope disclosure" section documenting the policy.docs/WORKFLOWS.md— PM-9 updated with the new section's happy path and empty-state edge case.tests/db/applicant-other-applications.test.ts— the seven db cases from the issue.tests/unit/utils.test.ts— threecanReviewPositioncases.Testing plan
/positions/[B]./positions/[B]loads. Confirm no manager name or email appears anywhere in the section (also check page source)./applications/[id].draftapplication on a third position → it does not appear. Withdraw one of their submitted applications → it still appears, badged "Withdrawn".closesAtbeyond 30 days → that row disappears. Leave one application atappliedinstead → the row stays.[]).Automated checks
npm run prettier:check— passnpm run eslint:check— passnpm run tsc:check— passnpm run test:unit— pass (230/230);tests/db/requires Postgres, unavailable in this worktree — CI will run itNotes
managersrelation to only the caller's own id, resolvingcanOpenserver-side.canOpenis a UI affordance, not a permission —/applications/[otherId]still enforces its own scope independently, so a stalecanOpen: true404s rather than leaking anything.takeon the query:Applicationis unique on[userId, positionId], so rows are bounded by the positions one applicant applied to, further trimmed byisPositionActive.