-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Sécurité] [BO] Améliorations du FileVoter #2696
Conversation
82d237c
to
07ab159
Compare
4f370f5
to
40cc8db
Compare
Retour de test : C'est le seul truc que j'ai remarqué pour l'instant. |
ok pour ce point |
Quality Gate failedFailed conditions |
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.
Un commentaire, mais tests OK
@@ -45,7 +45,7 @@ security: | |||
# https://symfony.com/doc/current/security.html#the-firewall | |||
|
|||
# https://symfony.com/doc/current/security/impersonating_user.html | |||
# switch_user: true | |||
#switch_user: {role: ROLE_ADMIN} |
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.
@numew je ne comprends pas ça.
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.
OK pour moi
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.
Un retour de test !
return $signalement->getAffectations()->filter(function (Affectation $affectation) use ($user) { | ||
return $affectation->getPartner()->getId() === $user->getPartner()->getId(); | ||
})->count() > 0 || $user->isTerritoryAdmin() && $user->getTerritory() === $signalement->getTerritory(); | ||
} | ||
|
||
public function canAddVisite(Signalement $signalement, User $user): bool | ||
{ | ||
if (Signalement::STATUS_ACTIVE !== $signalement->getStatut() && Signalement::STATUS_NEED_PARTNER_RESPONSE !== $signalement->getStatut()) { | ||
if (!\in_array($signalement->getStatut(), [Signalement::STATUS_ACTIVE, Signalement::STATUS_NEED_PARTNER_RESPONSE])) { |
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.
il faudrait aussi que l'affectation soit acceptée, non ?
en tant qu'admin territoire, même si je n'ai pas accepté, je peux ajouter des fichiers et des visites
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.
oui, alors j'ai aussi remarqué ca hier en validant la PR #2732 mais du coup ca semble être le fonctionnement actuel, on a fermé les yeux avec hélène....
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.
c'est pas l'occasion de le faire dans cette PR spécifique ?
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.
Tout est finalement ok, erreur de ma part !
Ticket
#2679
Description
FILE_CREATE
par l'existantSIGN_EDIT
qui est plus complet (et logiquement si l'on peux éditer les info d'un signalement on peux aussi y ajouter des documents)FILE_VIEW
par l'existantSIGN_VIEW
qui est plus complet (et logiquement si l'on peux consulter un signalement on peux voir ses documents)SIGN_VIEW
INTERVENTION_EDIT_VISITE
par l'existantSIGN_ADD_VISITE
qui fait les mêmes contrôlesFileVoter
SignalementVisitesController
ajout d'un contrôle de cohérence entre le signalement et l'affectation + retrait d'un appel au voterSIGN_VIEW
inutile (tous les contrôle étant déja correct dansSIGN_ADD_VISITE
Tests