[#325] Corrections diverses (!26)
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled

| Numéro du ticket | Titre du ticket |
|------------------|-----------------|
|         #325         |       Corrections diverses          |

## Description de la PR

## Modification du .env

## Check list

- [x] Pas de régression
- [ ] TU/TI/TF rédigée
- [x] TU/TI/TF OK
- [x] CHANGELOG modifié

Reviewed-on: #26
Reviewed-by: Autin <tristan@yuno.malio.fr>
Co-authored-by: kevin <kevin@yuno.malio.fr>
Co-committed-by: kevin <kevin@yuno.malio.fr>
This commit was merged in pull request #26.
This commit is contained in:
2026-02-13 08:10:33 +00:00
committed by Autin
parent 22b959de85
commit 7f3d9ef9c6
23 changed files with 384 additions and 274 deletions

View File

@@ -19,9 +19,11 @@ use Symfony\Component\Serializer\Attribute\Groups;
new Get(
requirements: ['id' => '\d+'],
normalizationContext: ['groups' => ['carrier:read']],
security: "is_granted('ROLE_USER')"
),
new GetCollection(
normalizationContext: ['groups' => ['carrier:read']],
security: "is_granted('ROLE_USER')"
),
new Post(
normalizationContext: ['groups' => ['carrier:read']],

View File

@@ -22,13 +22,10 @@ use Symfony\Component\Serializer\Attribute\Groups;
new Get(
requirements: ['id' => '\d+'],
normalizationContext: ['groups' => ['supplier:read']],
security: "is_granted('ROLE_USER')"
),
new GetCollection(
normalizationContext: ['groups' => ['supplier:read']],
),
new GetCollection(
uriTemplate: '/admin/suppliers',
normalizationContext: ['groups' => ['supplier:read']],
security: "is_granted('ROLE_ADMIN')"
),
new Post(

View File

@@ -21,8 +21,12 @@ final class UserPasswordProcessor implements ProcessorInterface
public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): mixed
{
if ($data instanceof User) {
$plain = $data->getPassword();
if ('' !== $plain) {
$plain = $data->getPassword();
$previous = $context['previous_data'] ?? null;
if ($previous instanceof User && $plain === $previous->getPassword()) {
// Password not changed in payload: keep existing hash.
$data->setPassword($previous->getPassword());
} elseif ('' !== $plain) {
$data->setPassword($this->hasher->hashPassword(
$data,
$plain