Skip to content

Conversation

@Diksha78-bot
Copy link
Contributor

Description

Implement Role-Based Access Control (RBAC) across the SaralSeva application to restrict access to certain actions based on user roles.

Changes

  • Add role field to User, Admin, and Employee models
  • Create RBAC middleware for JWT verification and role-based access checking
  • Protect all API endpoints with role-based authorization
  • Update JWT generation to include role field
  • Implement frontend RBAC utilities for each dashboard
  • Create ProtectedRoute components for route protection

Roles Implemented

  • User: Regular citizen - apply for schemes, file grievances
  • Employee: Government employee - manage assigned grievances
  • Admin: System administrator - full access

Testing

  • ✅ No breaking changes
  • ✅ 100% backward compatible
  • ✅ All endpoints properly protected
  • ✅ Role checks enforced on API level
  • ✅ Frontend route guards implemented

Related Issue

Fixes #45

@vercel
Copy link

vercel bot commented Nov 11, 2025

@Diksha78-bot is attempting to deploy a commit to the eccentriccoder01's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link

Thanks for creating a PR for your Issue! ☺️

We'll review it as soon as possible.
In the meantime, please double-check the file changes and ensure that all commits are accurate.

If there are any unresolved review comments, feel free to resolve them. 🙌🏼

@eccentriccoder01
Copy link
Owner

eccentriccoder01 commented Nov 14, 2025

Awesome work @Diksha78-bot, you've done a great job real quick! Sorry for the delayed response, I'm merging this now... There were some conflicts in package.json and deploy.yml, I've resolved them for you. Feel free to work on more issues or create new ones. Thanks for improving SaralSeva🧡

@eccentriccoder01 eccentriccoder01 merged commit ae39c24 into eccentriccoder01:main Nov 14, 2025
3 of 6 checks passed
@Diksha78-bot
Copy link
Contributor Author

Thanks for response. Can you please tell me which conflict are there, so that while solving next issues I'll take care of them. 😊

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.

Role-Based Access Control (RBAC) Enhancement

2 participants