Closed chanhlt closed 5 years ago
Actually, I forgot to set AclPermissionEvaluator for DefaultWebSecurityExpressionHandler.
@Override
public void configure(final WebSecurity web) throws Exception {
DefaultWebSecurityExpressionHandler handler = new DefaultWebSecurityExpressionHandler();
AclPermissionEvaluator permissionEva=new AclPermissionEvaluator(aclService);
permissionEva.setPermissionFactory(new CustomPermissionFactory());
handler.setPermissionEvaluator(permissionEva);
web.expressionHandler(handler);
web.ignoring().antMatchers("/static/**");
}
After doing this, everything works perfectly. :))
I am using Spring Boot 2.x.x with Spring security ACL. I have a problem with hasPermission(#vars.object, ‘edit’) in HTML file. It always returns FALSE. However, hasRole(‘admin’) works perfectly. And hasPermission(returnObject, ‘edit’) in Java code works too.
Did I miss something ?
It seems this one #17 is still remain.