Skip to content

Fix/judge case scope data isolation - #1641

Open
Nareshkumawat-star wants to merge 7 commits into
viru0909-dev:mainfrom
Nareshkumawat-star:fix/judge-case-scope-data-isolation
Open

Fix/judge case scope data isolation#1641
Nareshkumawat-star wants to merge 7 commits into
viru0909-dev:mainfrom
Nareshkumawat-star:fix/judge-case-scope-data-isolation

Conversation

@Nareshkumawat-star

Copy link
Copy Markdown

Pull Request: Fix Judge Dashboard Case Scope & Data Isolation Bug

Description

Fixes a high-severity data isolation vulnerability where judges were able to view and access cases outside their assigned court/docket.

Issue Resolved

Closes #1624

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Security enhancement / Data isolation enforcement

Key Changes Made

  1. Unified Judge Case Query:
    • Added JPQL findByAssignedJudgeOrJudgeId in CaseRepository.java to match cases by judgeId, assignedJudge (name), or assignedJudge (email).
  2. Judge Dashboard Filtering:
    • Updated getJudgeCases, getJudgeAnalytics, getTodaysHearings, and scheduleHearingAI in JudgeController.java to scope queries strictly to the authenticated judge's identity.
  3. RBAC Case Access Control:
    • Updated canAccessCase in CaseAccessService.java to block regular judges from accessing cases assigned to other judges (SUPER_JUDGE and ADMIN maintain administrative access).

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

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

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown
Contributor

Hi @Nareshkumawat-star, 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! 🚀

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] Judge dashboard shows all cases from all courts — no court-based filtering applied

1 participant