Skip to content

Commit

Permalink
#612 Victims allowed to use some endpoints in NeedController.
Browse files Browse the repository at this point in the history
  • Loading branch information
alitpc25 committed Dec 24, 2023
1 parent 5ef5ab6 commit ce38141
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class NeedController {
private NeedService needService;

@GetMapping("/viewNeedsByFilter")
@PreAuthorize("hasRole('FACILITATOR') or hasRole('COORDINATOR')")
@PreAuthorize("hasRole('VICTIM') or hasRole('FACILITATOR') or hasRole('COORDINATOR')")
public ResponseEntity<List<NeedDto>> viewNeedsByFilter(@RequestParam(required = false) BigDecimal longitude1,
@RequestParam(required = false) BigDecimal latitude1,
@RequestParam(required = false) BigDecimal longitude2,
Expand All @@ -47,7 +47,7 @@ public Long createNeed(@RequestParam Long userId, @RequestBody CreateNeedRequest
}

@GetMapping("/viewAllNeeds")
@PreAuthorize("hasRole('FACILITATOR')")
@PreAuthorize("hasRole('VICTIM') or hasRole('FACILITATOR')")
public ResponseEntity<List<NeedDto>> viewAllNeeds() {
log.info("Viewing all needs");
return needService.viewAllNeeds();
Expand Down Expand Up @@ -91,7 +91,7 @@ public ResponseEntity<String> cancelNeed(@RequestParam Long needId) {
}

@GetMapping("/filterByDistance")
@PreAuthorize("hasRole('FACILITATOR') or hasRole('COORDINATOR')")
@PreAuthorize("hasRole('VICTIM') or hasRole('FACILITATOR') or hasRole('COORDINATOR')")
public ResponseEntity<List<NeedDto>> filterByDistance(@RequestParam BigDecimal longitude,
@RequestParam BigDecimal latitude,
@RequestParam BigDecimal distance) {
Expand Down

0 comments on commit ce38141

Please sign in to comment.