[#538] Honor delegated hacker read and edit permissions - #539
Conversation
Co-authored-by: Codex <codex@openai.com>
📝 WalkthroughWalkthroughHacker management now supports Merge Risk: 🔵 Low · up to Blacklist protections work in the current implementation, but regression coverage and the feature contract should be corrected so restricted controls and API response shapes remain protected in future changes. 🚥 Pre-merge checks | ✅ 7 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (7 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 15 files. (4 skipped: 4 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-authored-by: Codex <codex@openai.com>
DVidal1205
left a comment
There was a problem hiding this comment.
lgtm but plz remove images from within the repo before merging
Co-authored-by: Codex <codex@openai.com>
There was a problem hiding this comment.
Note
Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.
🟡 Other comments (2)
apps/blade/src/tests/e2e/hacker-management.spec.ts-279-281 (1)
279-281: 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick winAssert both blacklist control names are absent
/Blacklist/does not matchRemove blacklist. Match both control names:Proposed fix
- await expect(dialog.getByRole("button", { name: /Blacklist/ })).toHaveCount( - 0, - ); + await expect( + dialog.getByRole("button", { + name: /^(Blacklist applicant|Remove blacklist)$/, + }), + ).toHaveCount(0);.forge/features/hacker-management/srd.md-43-45 (1)
43-45: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winSeparate the API redaction from the UI label.
previewBulkandconfirmBulkreturnreason: nullfor non-officer blacklist skips.bulk-confirm-dialog.tsxdisplays that value as “Requires officer review.” Update this sentence to describe both contracts; the SRD feeds implementation and test generation, so the current wording can cause an API-shape mismatch.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: QUIET
Plan: Team
Run ID: e9c1bc60-17e1-4191-be5e-a4b7efdb86b6
📒 Files selected for processing (19)
.forge/features/hacker-management/spec.md.forge/features/hacker-management/srd.md.forge/features/hacker-management/status.md.forge/features/hacker-management/test-cases.mdapps/blade/src/app/_components/admin/hackathon/hackers/bulk-confirm-dialog.tsxapps/blade/src/app/_components/admin/hackathon/hackers/hacker-detail-dialog.tsxapps/blade/src/app/_components/admin/hackathon/hackers/hacker-filters.tsxapps/blade/src/app/_components/admin/hackathon/hackers/hacker-roster.tsxapps/blade/src/app/_components/admin/hackathon/hackers/hacker-table.tsxapps/blade/src/app/admin/hackers/page.tsxapps/blade/src/app/admin/layout.tsxapps/blade/src/lib/admin-access.tsapps/blade/src/tests/admin/admin-access.test.tsapps/blade/src/tests/e2e/hacker-management.spec.tspackages/api/src/routers/hackathon-event.tspackages/api/src/routers/hacker.tspackages/api/src/tests/hacker/access.test.tspackages/api/src/tests/integration/hacker-guards.test.tspackages/api/src/utils/hacker/access.ts
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
Why
Organizers granted
READ_HACKERSandEDIT_HACKERSwere still redirected away from Hackers, and direct API calls returnedFORBIDDEN, because both Blade and the hacker router required officer status. The configurable permissions did not match their advertised behavior.What
Closes: #538
READ_HACKERSfor roster navigation, direct and legacy links, search/filter/counts, application details, and the detail panel's event attendance.EDIT_HACKERSincludes read access and gates profile, status, bulk, points, and deletion operations.Scope is Blade and the hacker-related API boundaries. Permission bits, schemas, dependencies, email-delivery mechanics, and check-in authorization are unchanged. This PR is based directly on
mainand does not include navigation PR #537.Test Plan
pnpm verify:precommitpassed: React analysis, formatting, lint (existing warnings), and root typecheck across API consumers.pnpm buildwas attempted and failed on missing local production environment variables: Guild requiresJUDGING_ACCESS_SECRETandNEXT_PUBLIC_BLADE_URL; 2026 requiresKHIX_HACKER_PORTAL_CLIENT_IDandKHIX_HACKER_PORTAL_ORIGIN. Turbo then canceled Blade/Club builds. A separatepnpm --filter=@forge/blade buildalso failed collecting/judge/endbecauseJUDGING_ACCESS_SECRETandNEXT_PUBLIC_BLADE_URLare missing. No environment validation was bypassed.Checklist
pnpm db:generateand committed the generated files inpackages/db/drizzle/