fix(security) : exclude ROLE_USER for ROLE_CLIENT users

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-15 19:20:46 +01:00
parent f4eec2e6e9
commit edc441f363

View File

@@ -96,7 +96,10 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
public function getRoles(): array public function getRoles(): array
{ {
$roles = $this->roles; $roles = $this->roles;
if (!in_array('ROLE_CLIENT', $roles, true)) {
$roles[] = 'ROLE_USER'; $roles[] = 'ROLE_USER';
}
return array_values(array_unique($roles)); return array_values(array_unique($roles));
} }