diff --git a/src/assets/user-management-spec.json b/src/assets/user-management-spec.json index 35ea002..ebf22e6 100644 --- a/src/assets/user-management-spec.json +++ b/src/assets/user-management-spec.json @@ -679,6 +679,58 @@ ] } }, + "/api/v1/permission/revoke": { + "put": { + "tags": [ + "User Management" + ], + "summary": "Revokes the user permissions", + "description": "Revokes the user permissions.", + "operationId": "revokePermission", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RoleDetails" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful response - Returns the boolean flag true.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Response" + } + } + } + }, + "400": { + "description": "Invalid request." + }, + "404": { + "description": "User not found." + }, + "500": { + "description": "Internal server error." + }, + "401": { + "description": "Unauthenticated request" + }, + "403": { + "description": "Unauthorized request" + } + }, + "security": [ + { + "AuthorizationToken": [] + } + ] + } + }, "/api/v1/project-group": { "get": { "tags": [ diff --git a/src/controller/user-management-controller.ts b/src/controller/user-management-controller.ts index 63eeecd..7c4c927 100644 --- a/src/controller/user-management-controller.ts +++ b/src/controller/user-management-controller.ts @@ -24,7 +24,7 @@ class UserManagementController implements IController { public intializeRoutes() { this.router.post(`${this.path}/api/v1/register`, validationMiddleware(RegisterUserDto), this.registerUser); this.router.post(`${this.path}/api/v1/permission`, authorizationMiddleware([Role.POC, Role.TDEI_ADMIN], true), validationMiddleware(RolesReqDto), this.updatePermissions); - // this.router.put(`${this.path}/api/v1/permission/revoke`, authorizationMiddleware([Role.POC, Role.TDEI_ADMIN], true), validationMiddleware(RolesReqDto), this.revokePermissions); + this.router.put(`${this.path}/api/v1/permission/revoke`, authorizationMiddleware([Role.POC, Role.TDEI_ADMIN], true), validationMiddleware(RolesReqDto), this.revokePermissions); this.router.get(`${this.path}/api/v1/roles`, authorizationMiddleware([Role.POC, Role.TDEI_ADMIN]), this.getRoles); this.router.get(`${this.path}/api/v1/project-group-roles/:userId`, authorizationMiddleware([], false, true), this.projectGroupRoles); this.router.post(`${this.path}/api/v1/authenticate`, validationMiddleware(LoginDto), this.login);