Replies: 1 comment
-
Right where you said you would put it. If you implement the filter on whatever level above, then you will be passing extra, possibly unneeded, information for the remaining use cases. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Let us assume that there is a parent entity organization. A user belongs to an organization.
Now, for example, when listing users, only those users should be returned who belong to the same organization.
In the context of the controller the request has the user.
My first approach would be to build a (global) filter at the model level that adds the organization to the existing filter. However, I haven't found a nice solution to "share" the current user without passing it on to the service. This seems not very elegant and full of redundancy.
At which point do you think it makes the most sense to implement this kind of filter?
Beta Was this translation helpful? Give feedback.
All reactions