allow to edit username (#4559)

This commit is contained in:
Kevin Papst
2024-01-14 13:02:44 +01:00
committed by GitHub
parent 5acd33dd64
commit fdda9841fa
6 changed files with 43 additions and 2 deletions

View File

@@ -309,15 +309,18 @@ final class ProfileController extends AbstractController
private function createEditForm(User $user): FormInterface
{
$currentUser = $this->getUser();
return $this->createForm(
UserEditType::class,
$user,
[
'action' => $this->generateUrl('user_profile_edit', ['username' => $user->getUserIdentifier()]),
'method' => 'POST',
'include_active_flag' => ($user->getId() !== $this->getUser()->getId()),
'include_active_flag' => $user !== $currentUser,
'include_preferences' => true,
'include_supervisor' => $this->isGranted('supervisor', $user),
'include_username' => $currentUser->isSuperAdmin() && $currentUser !== $user,
'include_password_reset' => $this->isGranted('password', $user),
]
);