📅  最后修改于: 2022-03-11 14:52:24.103000             🧑  作者: Mango
@GetMapping("/users")
public String getUsers() {
UserDetails details = userDetailsService.loadUserByUsername("mike");
if (details != null && details.getAuthorities().stream()
.anyMatch(a -> a.getAuthority().equals("ADMIN"))) {
// ...
}
}