Skip to content

Refactor permission management#2090

Open
rteas wants to merge 4 commits intohackforla:developmentfrom
rteas:refactor-permission-management
Open

Refactor permission management#2090
rteas wants to merge 4 commits intohackforla:developmentfrom
rteas:refactor-permission-management

Conversation

@rteas
Copy link
Member

@rteas rteas commented Feb 24, 2026

Fixes
#1861
#2066
#2068
#2072
#2075

What changes did you make and why did you make them ?

  • Refactored middleware/backend to use refresh tokens and json web tokens (jwts) - see auth.middleware.js, user.routes.js
  • Refactored frontend code to utilize most frontend code jwt via authContext.jsx
  • Both middle/back/front rely on the single source of truth (auth) in the shared folder with the following files: roles.js and authorizationUtils.js
No visuals, but website runs using access tokens (JWTS) 15m usage and Refresh Tokens (allowing users extended sessions up to 30 days without needing to relog into the application). Logging out will delete the refresh token and require users to re-login.

…via authcontext. AuthZ code builds on shared/roles and shared/authorizationUtils for a single source of truth for roles/accessLevels
…dmin(), hasMinimumRole(), or hasAnyRole() to showcase flexibility/options, also and adding comments to code
@rteas rteas requested review from geolunalg and trillium February 24, 2026 01:21
@JackHaeg
Copy link
Member

Note - once this PR is merged, hold off on rebuilding DEV until check-in for logged in users is enabled [add issue link here]. Otherwise, we may run into an issue where most users remain logged in and cannot check in without first logging back out of VRMS

@JackHaeg
Copy link
Member

@rteas mentioned that Project manager permissions are still handled the same way as before (standard user who is associated with a project = project manager). @rteas may create a new issue that creates a new UAL of "Project Manager" to follow the middleware refactor for other UALs (admin, superadmin, users, and project managers). Requires front end changes. Also, users assigned to an existing project will need to be promoted to "project manager" UAL in database.

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.

2 participants