Skip to content
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

Check model conditions during insert/update/delete #1044

Merged
merged 1 commit into from
Aug 5, 2022

Conversation

mvorisek
Copy link
Member

@mvorisek mvorisek commented Jul 31, 2022

fixes #866

Originally scope was honored for loading, but ignored for update. This PR makes sure scope is honored for update as well and nothing is updated outside scope. ACL and other security features can now rely on the strict scope behaviour.

Marking as BC breaking as when model's conditions are not met, DB update newly fails.

Soft delete (and simillar) implementations needs to be probably adjusted. Nested model can be used or scope must be "loosen" during operation with archived but normally out-of-scope records.

@mvorisek mvorisek force-pushed the stricter_update branch 2 times, most recently from 537df65 to 5287bc9 Compare August 3, 2022 14:20
@mvorisek mvorisek changed the title Always check all model conditions before update/delete Always check all model conditions before insert/update/delete Aug 3, 2022
@mvorisek mvorisek changed the title Always check all model conditions before insert/update/delete Always check all model conditions during insert/update/delete Aug 3, 2022
@mvorisek mvorisek changed the title Always check all model conditions during insert/update/delete Check model conditions during insert/update/delete Aug 3, 2022
@mvorisek mvorisek force-pushed the stricter_update branch 4 times, most recently from 34f86c4 to 1fbd714 Compare August 5, 2022 05:54
@mvorisek mvorisek marked this pull request as ready for review August 5, 2022 05:55
@mvorisek mvorisek merged commit d09466d into develop Aug 5, 2022
@mvorisek mvorisek deleted the stricter_update branch August 5, 2022 09:25
@mvorisek mvorisek added MAJOR and removed BC-break labels Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stricter insert/update/delete
1 participant