strategy-spring-security-acl icon indicating copy to clipboard operation
strategy-spring-security-acl copied to clipboard

Help Needed for JPA implementation

Open ghost opened this issue 7 years ago • 0 comments

@lordlothar99 Thank you so much for such a great library I am a little stuck in integrating it.

Step followed:

  1. I have defined EnableJpaRepositories like below @EnableJpaRepositories( value = "com.abc.repository", repositoryFactoryBeanClass = AclJpaRepositoryFactoryBean.class )
  2. 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.

ghost avatar Aug 04 '17 11:08 ghost