Spring 安全性:@PreAuthorized(hasAuthority) 以列表作为参数
Spring Security: @PreAuthorized(hasAuthority ) with list as parameters
是否可以将@PreAuthorize 和 hasAuthority 与值列表一起使用?
@PostMapping("/post")
@PreAuthorize("hasAuthority(#parameters.list)")
public Dto myController() {
//code here
}
为什么不使用 hasAnyAuthority?
哪个是您的用例?
是否可以将@PreAuthorize 和 hasAuthority 与值列表一起使用?
@PostMapping("/post")
@PreAuthorize("hasAuthority(#parameters.list)")
public Dto myController() {
//code here
}
为什么不使用 hasAnyAuthority?
哪个是您的用例?