Skip to content

Commit

Permalink
[SELC-4806] Feat: Added @PreAuthorize in getUserById API (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
flaminiaScarciofolo authored May 14, 2024
1 parent 7e5d891 commit 93423ea
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,18 @@ public void deleteRelationshipById(@ApiParam("${swagger.dashboard.user.model.id}
@GetMapping(value = "/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseStatus(HttpStatus.OK)
@ApiOperation(value = "", notes = "${swagger.dashboard.user.api.getUserByInternalId}", nickname = "v2GetUserByIdUsingGET")
@PreAuthorize("hasPermission(#institutionId, 'InstitutionResource', 'ADMIN')")
public UserResource getUserById(@ApiParam("${swagger.dashboard.user.model.id}")
@PathVariable("id") String userId,
@ApiParam("${swagger.dashboard.institutions.model.id}")
@RequestParam(value = "institutionId")
String institutionI,
String institutionId,
@ApiParam("${swagger.dashboard.user.model.fields}")
@RequestParam(value = "fields", required = false)
List<String> fields) {
log.trace("getUserById start");
log.debug("getUserById id = {}", userId);
User user = userService.getUserById(userId, institutionI, fields);
User user = userService.getUserById(userId, institutionId, fields);
log.debug(LogUtils.CONFIDENTIAL_MARKER, "getUserById = {}", user);
log.trace("getUserById end");
return userMapperV2.toUserResource(user);
Expand Down

0 comments on commit 93423ea

Please sign in to comment.