Replace global method security with method security

MSAL

@EnableGlobalMethodSecurity and <global-method-security> are deprecated in favor of @EnableMethodSecurity and <method-security>, respectively. The new annotation and XML element activate Spring’s pre-post annotations by default and use AuthorizationManager internally.

org.openrewrite.java.spring.security5.ReplaceGlobalMethodSecurityWithMethodSecurity
mod run . --recipe=org.openrewrite.java.spring.security5.ReplaceGlobalMethodSecurityWithMethodSecurity

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.