@RestController @RequestMapping(path = "/zoo") public class ZooController { @Secured(Role.Code.ADMIN) @PostMapping(path = "/add", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) public String addAnimal(@RequestBody String payload) { return "OK from post addAnimal"; } @Secured({Role.Code.USER, Role.Code.ADMIN}) @GetMapping(path = "/all") public Collection<String> getAnimals() { return List.of("OK from get"); } }