Consider I use Java config for spring security:
@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
...
}
How can I do analogue of XML configuration
<global-method-security secured-annotations="enabled" />
?
You can use @EnableGlobalMethodSecurity
annotation to configure that and set securedEnabled
annotation attribute to true
.
Enables Spring Security global method security similar to the
<global-method-security>
xml support.