fix(graph): avoid superfluous GetPublicShare call when deleting space permissions#12122
fix(graph): avoid superfluous GetPublicShare call when deleting space permissions#12122paul43210 wants to merge 3 commits intoowncloud:masterfrom
Conversation
|
|
I'm out of the loop at the moment so I can't test and verify the solution, but code looks good. |
|
@jvillafanez Thanks for the review! Here's a quick summary: The issue: When deleting a space-level permission (member/group grant), The fix: Space permission IDs have a distinctive format — they're prefixed with What changed:
|
a172793 to
42ed77b
Compare
… permissions DeletePermission unconditionally called getLinkPermissionResourceID as its first step, even for space permissions on space roots. This always failed and logged a confusing "GetPublicShare failed" error. Recognise space permission IDs (u:/g: prefixed) by their format via spacePermissionIdToCS3Grantee before making any gateway calls. Public link lookups on space roots now only happen when the ID does not match the space permission format. Fixes: owncloud#12012 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lexity Split DeletePermission into resolveDeletePermission, resolveSpaceRootPermission, and resolveItemPermission to bring cognitive complexity under the SonarCloud limit of 15. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
42ed77b to
5c59f2b
Compare



Summary
DeletePermissionunconditionally calledgetLinkPermissionResourceID(→GetPublicShare) as its first step, even when deleting space member permissions on space roots — producing a confusing "GetPublicShare failed" error logu:/g:prefixed) by their format viaspacePermissionIdToCS3Granteebefore making any gateway callsFixes: #12012
Test plan
deletes a space permission as expectedtest updated — no longer mocksGetPublicShare(verifying it's not called)🤖 Generated with Claude Code