Skip to content

Implement role-based access control and enhance security features#1926

Merged
vikrantwiz02 merged 3 commits into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:prod/acad-react
Jun 29, 2026
Merged

Implement role-based access control and enhance security features#1926
vikrantwiz02 merged 3 commits into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:prod/acad-react

Conversation

@vikrantwiz02

Copy link
Copy Markdown
Member

This pull request refactors authentication and authorization checks in the academic modules by replacing the use of the @login_required decorator with a new, more granular @require_designation decorator for view functions. This change enhances security by ensuring that only users with appropriate roles can access specific endpoints, and also introduces a missing @role_required(['student']) decorator in an API view. Additionally, some views and utility functions have had the login requirement removed entirely, likely because they are now only called internally or are otherwise protected.

The most important changes are:

Authorization and Authentication Improvements:

  • Replaced @login_required with @require_designation on key views in academic_procedures/views.py to enforce role-based access control for students, faculty, and admins. For example, student actions (like course registration) now require the "student" designation, and faculty/admin actions require their respective roles. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]
  • Added @role_required(['student']) to the get_next_sem_courses API view in academic_procedures/api/views.py to restrict access to students only.

Code Simplification and Cleanup:

Dependency Updates:

  • Imported the new require_designation decorator from applications.globals.access in academic_procedures/views.py.

These changes collectively improve the security model of the academic modules by ensuring that only users with the correct roles can access or modify sensitive academic data and actions.

@vikrantwiz02
vikrantwiz02 merged commit e57c2aa into FusionIIIT:prod/acad-react Jun 29, 2026
1 check passed
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