♻️ refactor(OwnershipChecker): Vague 2 SOLID — centralisation ownership, suppression 5 checks manuels#138
Merged
ronan-develop merged 2 commits intomainfrom Mar 16, 2026
Merged
Conversation
…p (qw-auth-checker)
…OwnershipChecker, supprimer 5 checks getId()===getId() manuels
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Objectif
Vague 2 — ticket
qw-auth-checker:Éliminer les 5 duplications
getOwner()->getId() === $user->getId()en créantOwnershipChecker.📋 Changements
Nouveau service
src/Security/OwnershipChecker.phpisOwner(Folder|Album|Share $resource): bool— vérifie sans lever d'exceptiondenyUnlessOwner(Folder|Album|Share $resource): void— 403 si non-ownerAuthenticationResolveren interne (pas de passage explicite deUser)Consommateurs refactorés
FolderProcessor::handlePatchFolderProcessor::handleDeleteAlbumProcessor::handlePatchAlbumProcessor::handleDeleteShareProcessor::getShareAsOwnerTotal : 5 checks manuels → 0
✅ Tests
287 tests, 605 assertions — tous passants
🔗 Référence
Plan :
.github/solid.md— Vague 2 (qw-auth-checker)