Skip to content

Commit

Permalink
Merge pull request #613 from bounswe/bugfix/BE-612-victims-should-be-…
Browse files Browse the repository at this point in the history
…allowed-to-filter-needs-on-the-map

#612 Victims allowed to use some endpoints in NeedController.
  • Loading branch information
furknbulbul authored Dec 24, 2023
2 parents 5ef5ab6 + ce38141 commit 4bc841a
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 4bc841a

Please sign in to comment.