strategy-spring-security-acl
strategy-spring-security-acl copied to clipboard
Help Needed for JPA implementation
@lordlothar99 Thank you so much for such a great library I am a little stuck in integrating it.
Step followed:
- I have defined EnableJpaRepositories like below
@EnableJpaRepositories( value = "com.abc.repository", repositoryFactoryBeanClass = AclJpaRepositoryFactoryBean.class )
- As I dont need any custom strategy, I haven't defined any. I am also not using GrantEvaluator so not implemented.
@Override protected MethodSecurityExpressionHandler createExpressionHandler() { DefaultMethodSecurityExpressionHandler expressionHandler = new DefaultMethodSecurityExpressionHandler(); expressionHandler.setPermissionEvaluator(new AclPermissionEvaluator(aclService())); expressionHandler.setRoleHierarchy(roleHierarchy()); return expressionHandler; }
I have used AclPermissionEvaluator and annotated my class with @EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
The problem I am facing is when I use a @PostFilter("hasPermission(filterObject.category, 'READ')")
it always return me all objects and not just the valid ACL objects.
Can you please guide me through.