Skip to content

Commit

Permalink
Merge pull request #477 from bounswe/feature/BE-476-victims-shall-be-…
Browse files Browse the repository at this point in the history
…able-to-view-resources

#476 Victim shall be able to view resources.
  • Loading branch information
furknbulbul authored Nov 27, 2023
2 parents ed67f2a + 4aab1cc commit d771ecc
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public ResponseEntity<Object> createResource(@RequestBody CreateResourceRequest
return resourceService.createResource(createResourceRequest);
}

@PreAuthorize("hasRole('RESPONDER') or hasRole('COORDINATOR')")
@PreAuthorize("hasRole('RESPONDER') or hasRole('COORDINATOR') or hasRole('VICTIM')")
@GetMapping("/viewResource")
public ResponseEntity<ResourceDto> viewResource(@RequestParam Long resourceId) {
log.info("Viewing resource with id: " + resourceId);
Expand All @@ -50,15 +50,15 @@ public ResponseEntity<String> deleteResource(@RequestParam Long resourceId) {
}


@PreAuthorize("hasRole('COORDINATOR')")
@PreAuthorize("hasRole('COORDINATOR') or hasRole('VICTIM') or hasRole('RESPONDER')")
@GetMapping("/filterByDistance")
public ResponseEntity<List<ResourceDto>> filterByDistance(@RequestParam
BigDecimal longitude, @RequestParam BigDecimal latitude, @RequestParam BigDecimal distance) {
log.info("Filtering resources by distance");
return resourceService.filterByDistance(latitude, longitude, distance);
}

@PreAuthorize("hasRole('COORDINATOR')")
@PreAuthorize("hasRole('COORDINATOR') or hasRole('VICTIM') or hasRole('RESPONDER')")
@GetMapping("/filterByCategory")
public ResponseEntity<List<ResourceDto>> filterByCategory(@RequestParam(required = false) String categoryTreeId,
@RequestParam(required = false) BigDecimal longitude,
Expand Down

0 comments on commit d771ecc

Please sign in to comment.