Skip to content

fix(admin): gate user management page to President/Technology Coordinator - #66

Merged
pranavb05 merged 1 commit into
mainfrom
fix/gate-users-page
Aug 25, 2026
Merged

pranavb05 merged 1 commit into
mainfrom
fix/gate-users-page

Conversation

@pranavb05

Copy link
Copy Markdown
Contributor

Why

/admin/users fetched all of admin.people with the service key (bypasses RLS) and its only protection was the layout's login check — any authenticated member could view every member's name, email, and role (audit finding: authenticated ≠ authorized).

What

Before running the service-key query, resolve the viewer from their session and require role ∈ {President, Technology Coordinator} — the same rule the user-mutation APIs already enforce. Unauthorized users are redirected to the dashboard; logged-out users to login.

The viewer's own-role lookup works under the new people_select_own RLS policy (#64), which permits reading your own row.

Verification

npm run build passes (41/41 pages).

…ator

The /admin/users page fetched all of admin.people with the service key
and only required a login, so any member could view every member's
name, email, and role. Require the viewer's role to be President or
Technology Coordinator (same rule as the user-mutation APIs); everyone
else is redirected to the dashboard.
@vercel

vercel Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ufdsi-com Ready Ready Preview Aug 25, 2026 6:44pm

@pranavb05
pranavb05 merged commit 3cbfcc5 into main Aug 25, 2026
3 of 4 checks passed

This branch was successfully deployed

1 active deployment
Preview – ufdsi-com — 72678fd0 Deployed Aug 25, 2026 by vercel[bot]
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.

1 participant