-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Description
Issue type: Feature request
Having a subscriber that triggers before/after a query/find event. In my current implementation the existing "before" subscribers are interacting with my Permissions class to enforce multi-tenant data separation, attaching the tenant ID to the data set for specific roles. It would also be useful to enforce this on get requests. Having this functionality in these hooks provides the ability for me to keep this logic in an area of the app that doesn't see a lot of maintenance, important to maintain the stability of our multitenant implementation, while also providing a DRY enforcement for all requests. This seems like an ideal use-case for the subscribers, but without some type of select/find/query event the functionality is incomplete.
That being said I'm new to Typeorm and may not be seeing the bigger picture, there may very well have been a good reason to avoid adding an event like this.