[ 'label' => 'Utilisateurs', 'role' => 'ROLE_USER', ], 'ROLE_ADMIN' => [ 'label' => 'Administrateurs', 'role' => 'ROLE_ADMIN', ], 'ROLE_SUPER_ADMIN' => [ 'label' => 'SuperAdmin', 'role' => 'ROLE_SUPER_ADMIN', ], ); public function getRoles(): array { return $this->roles; } public function getRole($role): ?array { if (isset($this->roles[$role])) { return $this->roles[$role]; } else { return null; } } public function getRolesList(): array { $rolesList = array(); foreach ($this->roles as $role) { $rolesList[$role['label']] = $role['role']; } return $rolesList; } }