How can I paginate with Spring Security, Hibernate and row level ACL

纵饮孤独 提交于 2019-12-05 01:38:15

问题


I'm reading about Spring Security and wonder whether it's possible to use Spring ACL together with hibernate and pagination. The resulting SQL is surely scary but possible to be auto-generated. It's even possible to use hierarchical ACL if the database supports recursive query evaluation.

Using a post filter is no solution since it breaks pagination and is an unnecessary overhead compared to ACL filtering inside the database.

So I actually have the pieces to build a solution. I want to know whether somebody has already done it.

Links:

  • Similar question from 2012 without response
  • link list about this question

回答1:


Yes there are solutions to your challenge. The field is called dynamic data masking and dynamic data filtering.

The idea is that you will have a proxy sit between your application and database. The proxy will apply the filtering such that only relevant authorized data is returned to the app hence keeping pagination intact.

Have a look at:

  • GreenSQL
  • Axiomatics Data Access Filter MD (demo)



回答2:


The way I dealing with this is first by getting a list of IDs my user has access to with the solution I gave here.

I then uses this list of IDs to do a query IN with that list.



来源:https://stackoverflow.com/questions/19620576/how-can-i-paginate-with-spring-security-hibernate-and-row-level-acl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!