question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add infrastructure for generic query augmentation [DATACMNS-293]

See original GitHub issue

Oliver Drotbohm opened DATACMNS-293 and commented

When working with repositories there might be use cases that involve the queries to be executed for that repository to contain some kind of global criteria. A good example for such a scenario is ACL based security to domain objects, e.g. with a global criteria causing the repository to only return domain objects created by the current user or only objects the current user is allowed to read.

A related example is working with data that has a soft-delete flag and essentially has to consider objects with that flag set to true non-existant.

Implementing these kinds of scenarios require the queries to the underlying store to be augmented with additional criterias. So we need to come up with some an SPI to prepare the query about to be executed and potentially even alter a delete(…) call into an update (for the soft-delete case).

From a more general point of view we need access to the method the query is executed for and it’s associated metadata


Issue Links:

  • SEC-2409 Spring Security / Spring Data Acl Integration (“is depended on by”)

  • DATAMONGO-1151 Introduce ability to append queries against a particular collection (“is depended on by”)

  • DATAJPA-307 Add support for soft deletes

  • DATAJPA-1551 Create an API to customize query creation and query processing

116 votes, 92 watchers

Issue Analytics

  • State:open
  • Created 11 years ago
  • Reactions:6
  • Comments:23

github_iconTop GitHub Comments

11reactions
spring-projects-issuescommented, Dec 30, 2020

Connor Sadler commented

Is this still being worked on please? Thanks

1reaction
GrantGochnauercommented, Jun 21, 2022

I just stumbled upon this ticket as it’s exactly what I was hoping was supported already out of box. Our use case, is that in a multi-tenancy system, we want to leverage authorization rules attached to roles that modify database queries - for example using the database to filter out documents that one might not have access to based on certain metadata values on those documents (and these fields we’d filter on are configurable by tenant).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introduce ability to append queries against a particular ...
I need to append all queri... ... DATACMNS-293 Add infrastructure for generic query augmentation ("depends on"). DATAJPA-307 Add support for soft deletes.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found