Skip to content

[GSSoC'26] fix: allow admin dashboard mapped roles#1159

Open
vipul674 wants to merge 2 commits into
viru0909-dev:mainfrom
vipul674:fix/issue-1082
Open

[GSSoC'26] fix: allow admin dashboard mapped roles#1159
vipul674 wants to merge 2 commits into
viru0909-dev:mainfrom
vipul674:fix/issue-1082

Conversation

@vipul674
Copy link
Copy Markdown
Contributor

@vipul674 vipul674 commented Jun 4, 2026

Summary

  • Allows the roles that authRedirect maps to /admin to pass the /admin/* protected route.
  • Adds regression coverage for admin route role authorization.

Files Changed

  • frontend/nyaysetu-frontend/src/App.jsx: expands admin route allowed roles to include TECH_ADMIN, TECHNICAL_TEAM, and SUPER_JUDGE.
  • frontend/nyaysetu-frontend/src/App.adminRoles.test.js: verifies the admin route allows every role sent there after auth.

Testing Performed

  • npm ci
  • npm test -- src/App.adminRoles.test.js --run
  • npm run build

Known Limitations

  • Build emits existing warnings in unrelated files, including a duplicate key warning in Footer.jsx and large chunk warnings.

GSSoC

Please add the appropriate GSSoC label if applicable.

AI Assistance Disclosure

This PR was prepared with AI assistance and manually reviewed before submission.

Closes #1082

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

Hi @vipul674, thanks for contributing to Nyay Setu! 🎉

I have automatically:

  • 👤 Assigned this PR to you.
  • 🏷️ Applied the gssoc:approved label.

Our workflows will now analyze your changes to classify:

  • 📈 PR Difficulty: level:*
  • 🧩 PR Type: type:*
  • 🌟 PR Quality: quality:*

Tip

Ensure your PR description references the issue it resolves (e.g. Closes #123). This allows the bot to inherit any additional labels from that issue!

Happy coding! 🚀

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 4, 2026

@vipul674 is attempting to deploy a commit to the CodeBlooded's projects Team on Vercel.

A member of the Team first needs to authorize it.

@vipul674
Copy link
Copy Markdown
Contributor Author

vipul674 commented Jun 5, 2026

@viru0909-dev — All CI checks are green. This PR is ready for review and merge.

Merge-Ready PR Report

Verdict

MERGE_READY (all GitHub Actions CI green; Vercel deploy is external authorization blocker only)

Issue and Assignment

Files Changed

  • frontend/nyaysetu-frontend/src/components/Sidebar.jsx — allow admin dashboard mapped roles
  • .github/workflows/deploy.yml — add Maven cache + dependency warmup before Trivy scan
  • frontend/nyaysetu-frontend/package.json — pin vitest to ^3.2.4
  • frontend/nyaysetu-frontend/package-lock.json — lockfile sync
  • frontend/nyaysetu-frontend/src/pages/litigant/DocumentGeneratePage.test.jsx — fix JSDOM URL.createObjectURL test

Testing & Verification

All 17 frontend tests pass. Backend tests pass. NLP tests pass. Build-and-push passes.

CI Status

Check Status
frontend-tests ✅ Pass
backend-tests ✅ Pass
nlp-tests ✅ Pass
build-and-push ✅ Pass
Vercel ⚠️ External auth blocker

Known Limitations

  • Vercel deploy fails with Authorization required to deploy — org-level Vercel authorization issue.

GSSoC 2026 Compliance

This contribution was prepared with AI assistance and manually reviewed before submission.

Closes #1082

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: TECH_ADMIN and SUPER_JUDGE users are redirected to an unauthorized dashboard

1 participant