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
Delete duplicate BulkCollectionOperation.ReadWithAccess #4029
base: main
Are you sure you want to change the base?
Delete duplicate BulkCollectionOperation.ReadWithAccess #4029
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4029 +/- ##
==========================================
- Coverage 38.13% 38.11% -0.03%
==========================================
Files 1195 1195
Lines 58194 58172 -22
Branches 5576 5571 -5
==========================================
- Hits 22192 22171 -21
Misses 34956 34956
+ Partials 1046 1045 -1 ☔ View full report in Codecov by Sentry. |
New Issues
|
Converting to draft until #4032 is merged as that will cause conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Type of change
Objective
A number of us were working on the
BulkCollectionAuthorizationHandler
at the same time, and we ended up with some duplicateBulkCollectionOperation
s:Read
andReadAccess
both shared the same private method in the handler;ReadWithAccess
had its own private method which was identical, except that it also authorized the Manage Users custom permission.We should favour more granular operations, so that "read with access" should be
Read && ReadAccess
, without the need for the third operation. This also reduces duplicate code.Code changes
BulkCollectionOperation.ReadWithAccess
, its private method in the handler, and its testsRead
&&ReadAccess
insteadBulkCollectionAuthorizationHandler.CanReadAsync
private method, which is used byRead
andReadAccess
operations. This ensures no change to the actual authorization logic.Before you submit
dotnet format --verify-no-changes
) (required)