From b274cd672b161a2f3cbfe3604daf05e90e7d5e93 Mon Sep 17 00:00:00 2001 From: Piyush Date: Tue, 28 Jan 2025 18:43:39 +0530 Subject: [PATCH] Done ticket GEPAFINBE-151 --- .../impl/ApplicationAmendmentRequestServiceImpl.java | 1 - .../web/rest/api/ApplicationAmendmentRequestApi.java | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/gepafin/tendermanagement/service/impl/ApplicationAmendmentRequestServiceImpl.java b/src/main/java/net/gepafin/tendermanagement/service/impl/ApplicationAmendmentRequestServiceImpl.java index e2615a71..0d44c22b 100644 --- a/src/main/java/net/gepafin/tendermanagement/service/impl/ApplicationAmendmentRequestServiceImpl.java +++ b/src/main/java/net/gepafin/tendermanagement/service/impl/ApplicationAmendmentRequestServiceImpl.java @@ -84,7 +84,6 @@ public class ApplicationAmendmentRequestServiceImpl implements ApplicationAmendm @Override public List getAllApplicationAmendmentRequest(HttpServletRequest request,Long userId) { - UserEntity user = validator.validatePreInstructor(request, userId); return applicationAmendmentRequestDao.getAllApplicationAmendmentRequest(request,userId); } diff --git a/src/main/java/net/gepafin/tendermanagement/web/rest/api/ApplicationAmendmentRequestApi.java b/src/main/java/net/gepafin/tendermanagement/web/rest/api/ApplicationAmendmentRequestApi.java index 0918b918..1f1ca862 100644 --- a/src/main/java/net/gepafin/tendermanagement/web/rest/api/ApplicationAmendmentRequestApi.java +++ b/src/main/java/net/gepafin/tendermanagement/web/rest/api/ApplicationAmendmentRequestApi.java @@ -18,6 +18,7 @@ import net.gepafin.tendermanagement.model.util.Response; import net.gepafin.tendermanagement.web.rest.api.errors.ErrorConstants; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -85,9 +86,10 @@ public interface ApplicationAmendmentRequestApi { @ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })), @ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = { @ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) }) - @GetMapping(value = "/user/{id}", produces = "application/json") + @GetMapping(value = "/user", produces = "application/json") + @PreAuthorize("hasRole('ROLE_SUPER_ADMIN') || hasRole('ROLE_INSTRUCTOR_MANAGER')|| hasRole('ROLE_PRE_INSTRUCTOR')") ResponseEntity>> getAllApplicationAmendmentRequest(HttpServletRequest request, - @Parameter(description = "The User ID", required = false) @PathVariable(value = "id",required = false) Long userId); + @Parameter(description = "The User ID", required = false) @RequestParam(value = "userId",required = false) Long userId); @Operation(summary = "Api to update application amendment", responses = {