Refactor Permission Management to a Middleware-Based Solution
Overview
The current VRMS permission system (accessLevel) relies on hardcoded values / string matching checks (e.g., is_admin), which limits flexibility and maintainability. To enhance scalability and streamline permission management, permissions should be refactored into a middleware-based solution. This will allow for centralized handling and easier updates across the application.
Action Items
- [ ] Research approaches for refactoring the current permission system into a middleware-based solution.
- Ensure that the new implementation supports upcoming User Permission Search features, which are set to be merged in #1737.
- [ ] Design and document middleware architecture, including:
- Permission validation workflows.
- Integration points with existing authentication mechanisms.
- [ ] Create diagrams outlining the proposed middleware solution to illustrate system interactions and permission handling.
Resources/Instructions
- Review the related issue that uncovered this problem: #1802.
- Ensure alignment with existing authentication and authorization best practices.
@ntrehan Here is the draft of the research issue we discussed in our last team call re: refactoring a middleware-based solution for VRMS permissions. Please feel free to edit this issue as you see fit and reach out if you have any questions!
Hi @ntrehan! When you have a moment, can you please provide an update with the following information:
- Progress: "What is the current status of your project? What have you completed and what is left to do?"
- Blockers: "Difficulties or errors encountered."
- Availability: "How much time will you have this week to work on this issue?"
- ETA: "When do you expect this issue to be completed?"
- Pictures or links* (if necessary): "Add any pictures or links that will help illustrate what you are working on."
- remember to add links to the top of the issue if they are going to be needed again.
Hi @JackHaeg Sure!
- Have discussed the approaches to convert it into a "prop" based solution with the team
- No blockers as such but the biggest challenge would be the inconsistencies within VRMS modules. So it might be complicated to unite them into one solution.
- I will be available for 3 hours this week
- I anticipate around 3 weeks for this issue (24th March 2025)
Hi @ntrehan! When you have a moment, can you please provide an update with the following information:
- Progress: "What is the current status of your project? What have you completed and what is left to do?"
- Blockers: "Difficulties or errors encountered."
- Availability: "How much time will you have this week to work on this issue?"
- ETA: "When do you expect this issue to be completed?"
- Pictures or links* (if necessary): "Add any pictures or links that will help illustrate what you are working on."
- remember to add links to the top of the issue if they are going to be needed again.
Hi @ntrehan are you still planning to work on this issue? If so, please provide an update with the following information. Also, if you are no longer planning to work on VRMS, we would be super grateful if you could share any progress or potential next steps on this issue in a comment :)
Update info:
1. Progress: "What is the current status of your project? What have you completed and what is left to do?" 2. Blockers: "Difficulties or errors encountered." 3. Availability: "How much time will you have this week to work on this issue?" 4. ETA: "When do you expect this issue to be completed?" 5. Pictures or links* (if necessary): "Add any pictures or links that will help illustrate what you are working on." - remember to add links to the top of the issue if they are going to be needed again.
@ntrehan has left the VRMS team. Unassigning from this issue and placing back in the prioritized backlog.
- Progress: "What is the current status of your project? What have you completed and what is left to do?"
- Middle of researching two solutions. An inbuilt solution on server or utilizing 3rd party application to host as identity provider (idP)
- Blockers: "Difficulties or errors encountered."
- N/A
- Availability: "How much time will you have this week to work on this issue?"
- 10-15 hrs
- ETA: "When do you expect this issue to be completed?"
- Depends on solution/path chosen, 3rd party solution will take more time to integrate , but is potentially re-usable through other HFLA apps and can provide SSO
- Pictures or links* (if necessary): "Add any pictures or links that will help illustrate what you are working on." https://github.com/authelia/authelia https://github.com/keycloak/keycloak https://github.com/goauthentik/authentik
Thanks for the update, @rteas! Happy to discuss any questions on this issue during tonight's call with the team.
- @rteas to conduct more research on 3rd parties vs. inbuilt solution, and will follow up with @trillium, @geolunalg & @kkchu791 on slack
Google Slide Documentation: Middleware Permission Management/Refactor Third Party AuthZ Tradeoffs