Custom PermissionEvaluator doesn't work
<p>I tried to write own impementation of PermissionEvaluator. Here it is:</p>

<pre><code>public class PermissionEvaluatorImpl implements PermissionEvaluator {
public PermissionEvaluatorImpl() {
}

@Override
public boolean hasPermission(Authentication authentication, Object targetDomainObject, Object permission) {
    final CustomUser customUser = (CustomUser) authentication.getPrincipal();
    //Some custom logic
    System.out.println("TEST");
    return false;
}

@Override
public boolean hasPermission(Authentication authentication, Serializable targetId, String targetType, Object permission) {
    System.out.println("TEST");
    return false;
}
}
</code></pre>

<p>The main problem, how I understood is saying to <code>DefaultMethodSecurityExpressionHandler</code>, that It must use mine. I tried to do it many ways:</p>

<pre><code>@Bean
DefaultMethodSecurityExpressionHandler defaultMethodSecurityExpressionHandler(){
    DefaultMethodSecurityExpressionHandler defaultMethodSecurityExpressionHandler = new DefaultMethodSecurityExpressionHandler();
    defaultMethodSecurityExpressionHandler.setPermissionEvaluator(new PermissionEvaluatorImpl());
    return defaultMethodSecurityExpressionHandler;
}
</code></pre>

<p>Tried to autowire it (because it's annotated @Component, I can change it's field after all initializations), but it isn't still working.
I also tried to make my PermissionEvaluator @Component, then set it in DefaultMethodSecurityExpressionHandler's field. This way was the same (nothing works).
I also thought, that I put <code>@PreAuthorize</code> in incorrect place, so I marked with this annotation all layers (Controller,Service,DAO). Still not working</p>