Profile management and role-based access#19
Open
Khan-DevHub wants to merge 4 commits into
Open
Conversation
|
@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. |
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! |
Author
|
87ea6d1 to
beb9a94
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.