π Title
Implement complete RBAC (Role-Based Access Control) system
π Description
There is currently no authorization layer in the API β only JwtAuthGuard (authentication) exists. The users table has no role column, and there are no @Roles decorators or RolesGuard anywhere in src/. This blocks admin-only operations (loan overrides, merchant approval, system health) and any endpoint that should be restricted by user type.
Also fix a related bug found during investigation: GET /reputation/me (src/modules/reputation/reputation.controller.ts) reads req.user?.wallet but has no @UseGuards(JwtAuthGuard), leaving it unprotected.
β
Tasks to complete
π Documentation/context for AI
(This link never should removed)
https://github.com/TrustUp-app/TrustUp-API/tree/main/docs
ποΈ Additional notes
No role field or RBAC infrastructure exists today β this is greenfield work, not an extension of an existing system.
π Title
Implement complete RBAC (Role-Based Access Control) system
π Description
There is currently no authorization layer in the API β only
JwtAuthGuard(authentication) exists. Theuserstable has norolecolumn, and there are no@Rolesdecorators orRolesGuardanywhere insrc/. This blocks admin-only operations (loan overrides, merchant approval, system health) and any endpoint that should be restricted by user type.Also fix a related bug found during investigation:
GET /reputation/me(src/modules/reputation/reputation.controller.ts) readsreq.user?.walletbut has no@UseGuards(JwtAuthGuard), leaving it unprotected.β Tasks to complete
roleenum column tousers(admin,merchant,lp-provider,borrower)UserRoleenum +@Roles()decorator +RolesGuard@UseGuards(JwtAuthGuard)onGET /reputation/meπ Documentation/context for AI
(This link never should removed)
https://github.com/TrustUp-app/TrustUp-API/tree/main/docs
ποΈ Additional notes
No
rolefield or RBAC infrastructure exists today β this is greenfield work, not an extension of an existing system.