Код: Выделить всё
@GetMapping
@PreAuthorize("(hasAuthority('DOMAIN_FIND_ALL'))")
public ResponseEntity findAll() {
return ResponseEntity.ok().body(domainService.findAll());
}
Код: Выделить всё
@GetMapping
@PreAuthorize("(hasAuthority('DOMAIN_FIND_ALL') or (hasAuthority('SUPER'))")
public ResponseEntity findAll() {
return ResponseEntity.ok().body(domainService.findAll());
}
Что я пробовал:
Код: Выделить всё
@Override
public void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.authorizeRequests()
.otherStuffs..
.antMatchers("/**").authenticated()
.antMatchers("/**").hasRole("SUPER");
}
Подробнее здесь: https://stackoverflow.com/questions/650 ... ecifc-role