Skip to content

Profile management and role-based access#19

Open
Khan-DevHub wants to merge 4 commits into
Asakusa-k:mainfrom
Khan-DevHub:feature/profiles
Open

Profile management and role-based access#19
Khan-DevHub wants to merge 4 commits into
Asakusa-k:mainfrom
Khan-DevHub:feature/profiles

Conversation

@Khan-DevHub
Copy link
Copy Markdown

SUMMARY:
This PR adds role-based access control and profile management features to the backend.

-Added role-based access middleware (role.middleware.js).
-Extended user profile with fields: bio, company, investmentHistory, preferences.
-Implemented PUT /api/users/profile to update profile.
-Added role-specific endpoints: /api/users/investor/dashboard and /api/users/entrepreneur/dashboard.
-Tested all endpoints with Thunder Client for both roles.

Changes:
-backend/controllers/user.controller.js
-backend/middleware/role.middleware.js
-backend/routes/user.routes.js
-backend/models/User.js (profile extension)

Testing:
-Investor token → investor dashboard works, entrepreneur dashboard returns 403.
-Entrepreneur token → entrepreneur dashboard works, investor dashboard returns 403.
-Profile update works for both roles.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 14, 2026

@Khan-DevHub is attempting to deploy a commit to the Asakusa's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Khan-DevHub
Copy link
Copy Markdown
Author

Hi @Asakusa-k,

I noticed that the Vercel checks are pending authorization from a team member. Could you please review and authorize the deployment when you have a moment?

The PR is ready to go – all code is working and tested locally with both investor and entrepreneur roles.

Thanks!

@Khan-DevHub
Copy link
Copy Markdown
Author

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