Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help Needed for JPA implementation #38

Open
ghost opened this issue Aug 4, 2017 · 0 comments
Open

Help Needed for JPA implementation #38

ghost opened this issue Aug 4, 2017 · 0 comments

Comments

@ghost
Copy link

ghost commented Aug 4, 2017

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants