14.1.2 在 Spring Security 中使用 JSR-250 的 @RolesAllowed 注解
@Configuration
@EnableGlobalMethodSecurity(jsr250Enable=true)
public class MethodSecurityConfig extends GlobalMethodSecurityConfiguration {
}@RolesAllowed("ROLE_SPITTER")
public void addSpittle(Spittle spittle) {
// ...
}Last updated