I am using ABAC model for securing access to some entities in project. According to https://dzone.com/articles/simple-attribute-based-access-control-with-spring, I can easily define some policy rules for updating/deleting entities in project.
After many hours of searching, I came across the only normally documented way to filter data available to the user: using Spring security @PostFilter
.
The problem is the performance of this approach. What are the available ways to shift the responsibility for filtering data to the database, while not mixing business and the logic of the role model?
So far I have tried only coding up the JPA Specification: the module responsible for the role model takes into account the user's parameters (id, group_id / organization_id) to compose logical expressions, and all the parameters by which the business needs to filter are added to composed of such Specification expressions. But this solution forces to use only specification for data retrieval. Moreover, it is not very clear how to store these expressions in the policy store.