Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Role-Based Access Control for Lender Role #31

Open
gchyuli opened this issue Feb 21, 2025 · 4 comments · May be fixed by #43
Open

Integrate Role-Based Access Control for Lender Role #31

gchyuli opened this issue Feb 21, 2025 · 4 comments · May be fixed by #43
Assignees
Labels
External contributors good first issue Good for newcomers Manteiner - Yuli ODBuild Further information is requested

Comments

@gchyuli
Copy link
Collaborator

gchyuli commented Feb 21, 2025

Description 📺

Current: The frontend currently supports only the borrower role, and there is no role-based access control to restrict or enable features for lenders.

New Design: Implement role-based access control to integrate the lender role properly and ensure they have access to lender-specific functionalities.

Proposed Actions 🛠️

Fork and Create Branch:

git checkout -b feature-role-access-lender-[issue-number]

Implement Changes:

  • Fetch User Role:
    • On page load or navigation, fetch the user's role from the backend (if not already stored).
  • Update Navigation:
    • Modify the navigation menu to support lenders, providing access to lender-specific pages:
      • Lenders: Access to /lender/dashboard.
      • Borrowers: Retain access to all routes actually are.
  • Route Guards:
    • Implement route guards to ensure that lenders can access only lender-specific pages.
    • Redirect borrowers away from lender-exclusive sections.
  • Error Handling:
    • Add a 403 Forbidden page for unauthorized access attempts.
    • Display an appropriate error message if the role cannot be determined.

Run Tests and Commit Changes:

  • Write unit and integration tests for role-based access control for lenders.
git commit -m "Feature: Implement role-based access control for lender role"

Acceptance Criteria ✅

  • Users can only access routes and components relevant to their role.
  • The lender role is properly integrated into the frontend.
  • Unauthorized access attempts are blocked with redirection or a 403 Forbidden page.
@techpilot
Copy link

May I be assigned to this? I can get this task done in few hours once assigned to me

@gchyuli gchyuli added good first issue Good for newcomers ODBuild Further information is requested External contributors Manteiner - Yuli labels Feb 21, 2025
@MPSxDev
Copy link

MPSxDev commented Feb 21, 2025

Hello @gchyuli ! I would like to request assignment to this issue.

About Me:

I have experience maintaining Web3 projects and working with emerging technologies. I understand the importance of secure access control, especially in decentralized environments. I can leverage my experience to ensure a robust and user-friendly role-based access control system.

Work Plan:

  1. Fetch user role
  2. Update navigation for lenders (/lender/dashboard), ensuring a clean and intuitive integration with the existing UI.
  3. Implement route guards to restrict lender-specific access for borrowers.
  4. Implement a 403 Forbidden page for unauthorized access, styled to match the existing design.

Definition of Done:

  • User roles are fetched correctly.
  • Navigation adapts to user roles.
  • Route guards enforce role-based access.
  • A 403 Forbidden page is displayed for unauthorized access.

Estimated Delivery Time:

I estimate completion within 24 hours.

I am excited to contribute to this awesome project. Thank you for your consideration! I am available to begin working on this immediately upon assignment.

@gchyuli
Copy link
Collaborator Author

gchyuli commented Feb 24, 2025

Hi @MPSxDev please solve the issue as soon as possible. If you have any doubt, can tell me!

@MPSxDev
Copy link

MPSxDev commented Feb 24, 2025

Hi @MPSxDev please solve the issue as soon as possible. If you have any doubt, can tell me!

@gchyuli Perfect, tomorrow morning it's ready.

@MPSxDev MPSxDev linked a pull request Feb 24, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External contributors good first issue Good for newcomers Manteiner - Yuli ODBuild Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants