feat: implement Role-Based Access Control (RBAC) middleware for internal Admin dashboards#1971
feat: implement Role-Based Access Control (RBAC) middleware for internal Admin dashboards#1971knoxiboy wants to merge 2 commits into
Conversation
|
@knoxiboy is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel. A member of the Team first needs to authorize it. |
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds admin-only access control for /admin routes in the Next.js middleware.
Changes:
- Introduced an
adminRoutesallowlist andisAdminRoutedetection. - Enforced authentication for admin routes and returned
403for non-admin users.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This PR has merge conflicts with git fetch origin
git rebase origin/main
# Carefully integrate the RBAC admin route check alongside the existing auth rate limiting logic
git push --force-with-lease |
ab39f1a to
47c58a8
Compare
Pull Request
Description
This PR addresses Issue #1933 by implementing Role-Based Access Control (RBAC) middleware for internal Admin dashboards.
src/middleware.tsto intercept requests to/adminroutes.adminrole before allowing access, returning a 403 Forbidden response otherwise.Closes #1933
Type of change
Checklist: