-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: add EntityEdgeDeletionAuthorizationInferenceBehavior for canViewerDeleteAsync #243
feat: add EntityEdgeDeletionAuthorizationInferenceBehavior for canViewerDeleteAsync #243
Conversation
bc50215
to
3df1bab
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @wschurman and the rest of your teammates on Graphite |
3df1bab
to
90fd858
Compare
43e7c9c
to
2b13138
Compare
90fd858
to
79be321
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #243 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 72 72
Lines 1949 1970 +21
Branches 267 278 +11
=========================================
+ Hits 1949 1970 +21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
2b13138
to
0492011
Compare
31cef74
to
7954f53
Compare
7954f53
to
265b641
Compare
One concept I'd like to be able to express alongside this (that I haven't figured out yet) is the ability to ensure Put another way, the most common use of this will likely be doing a simple optimistic check ahead of long-running bulk/batch deletion of a tree of entities. It'd be nice to be able to limit how many entities can be loaded in that execution of |
Why
This PR adds a new concept for optimized evaluation of
canViewerDeleteAsync
:EntityEdgeDeletionAuthorizationInferenceBehavior
.The way it works is: when the method goes to recursively authorize all cascading deletes/set-nulls for an entity being checked in
canViewerDeleteAsync
, an application developer can specify that checking one instance of an edge of an association type is sufficient for inferring that all edges share the same privacy checks and loading all of them isn't necessary. Without this, all edges are loaded and authorization to cascade delete / set null are checked individually.This is more of a best-effort optimistic evaluation to tell ahead of time whether a deletion will succeed or fail, and is not used during actual deletion since an application developer may apply it incorrectly.
It was inspired by this comment: #224 (review)
How
Add concept with explanation in comments, add tests.
Test Plan
Run tests.