-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow update and delete to specify a condition #135
Comments
I'm not the project maintainer in any capacity, I'm just throwing this in from a typical webdevs perspective. Architecturally speaking, validating whether an incoming HTTP Request has the necessary permission to do X is typically done in middlewares of the application before the controller of a given endpoint is even touched. Thus my first instinct would be to warn against granting this ability. I assume count and sum (and other aggregatation procs I'd wager, if there are further ones)have the ability to add conditions solely so that you can filter precisely which entries you count and build sums from, for update that isn't specifically necessary as there's one specific entry you want to update with a specific set of values. Feel free to counter me here, I'm interested whether there's a usecase I might be missing for this. |
To clarify further: |
Use case here is pretty common, let's say you've got a comment:
I'd like to be able to do something like
It makes it much easier to ensure that updates are only happening to an item that a user owns/created. Right now I'm doing the checking manually, which results in additional select queries. Something similar already exists for count and sum, as they take additional conditions.
The text was updated successfully, but these errors were encountered: