@EnableGlobalMethodSecurity is deprecated in the new spring boot 3.0

You can use now:

@EnableMethodSecurity

Check the documentation

Note that you can avoid using prePostEnabled = true, because by default is true.

boolean prePostEnabled() default true;
boolean jsr250Enabled() default false;
boolean proxyTargetClass() default false;

Leave a Comment