// Path: src/main/java/org/andidev/applicationname/config/springsecurity/CustomMethodSecurityExpressionHandler.java
// public class CustomMethodSecurityExpressionHandler extends DefaultMethodSecurityExpressionHandler {
// 
//     private AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl();
// 
//     @Override
//     protected MethodSecurityExpressionOperations createSecurityExpressionRoot(Authentication authentication, MethodInvocation invocation) {
//         CustomWebAndMethodSecurityExpressionRoot root = new CustomWebAndMethodSecurityExpressionRoot(authentication);
//         root.setThis(invocation.getThis());
//         root.setPermissionEvaluator(getPermissionEvaluator());
//         root.setTrustResolver(trustResolver);
//         root.setRoleHierarchy(getRoleHierarchy());
//         return root;
//     }
// 
//     @Override
//     public void setTrustResolver(AuthenticationTrustResolver trustResolver) {
//         Assert.notNull(trustResolver, "trustResolver cannot be null");
//         this.trustResolver = trustResolver;
//     }
// }


import org.andidev.applicationname.config.springsecurity.CustomMethodSecurityExpressionHandler;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration;
package org.andidev.applicationname.config;


@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class SpringMethodSecurityConfig extends GlobalMethodSecurityConfiguration {

    @Override
    protected MethodSecurityExpressionHandler createExpressionHandler() {
// Path: src/main/java/org/andidev/applicationname/config/springsecurity/CustomMethodSecurityExpressionHandler.java
// public class CustomMethodSecurityExpressionHandler extends DefaultMethodSecurityExpressionHandler {
// 
//     private AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl();
// 
//     @Override
//     protected MethodSecurityExpressionOperations createSecurityExpressionRoot(Authentication authentication, MethodInvocation invocation) {
//         CustomWebAndMethodSecurityExpressionRoot root = new CustomWebAndMethodSecurityExpressionRoot(authentication);
//         root.setThis(invocation.getThis());
//         root.setPermissionEvaluator(getPermissionEvaluator());
//         root.setTrustResolver(trustResolver);
//         root.setRoleHierarchy(getRoleHierarchy());
//         return root;
//     }
// 
//     @Override
//     public void setTrustResolver(AuthenticationTrustResolver trustResolver) {
//         Assert.notNull(trustResolver, "trustResolver cannot be null");
//         this.trustResolver = trustResolver;
//     }
// }


// Path: src/main/java/org/andidev/applicationname/config/SpringMethodSecurityConfig.java
import org.andidev.applicationname.config.springsecurity.CustomMethodSecurityExpressionHandler;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration;

package org.andidev.applicationname.config;


@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class SpringMethodSecurityConfig extends GlobalMethodSecurityConfiguration {

    @Override
    protected MethodSecurityExpressionHandler createExpressionHandler() {
        CustomMethodSecurityExpressionHandler expressionHandler = new CustomMethodSecurityExpressionHandler();