diff --git a/migrations/Version20241121151633.php b/migrations/Version20241121151633.php new file mode 100644 index 0000000..b9a833a --- /dev/null +++ b/migrations/Version20241121151633.php @@ -0,0 +1,31 @@ +addSql('CREATE SCHEMA public'); + } +} diff --git a/src/Controller/RegistrationController.php b/src/Controller/RegistrationController.php index b078d9d..50e84c2 100644 --- a/src/Controller/RegistrationController.php +++ b/src/Controller/RegistrationController.php @@ -28,6 +28,7 @@ class RegistrationController extends AbstractController /** @var string $plainPassword */ $plainPassword = $form->get('plainPassword')->getData(); + $user->setRoles(['ROLE_INTERN']); // encode the plain password $user->setPassword($userPasswordHasher->hashPassword($user, $plainPassword)); @@ -55,6 +56,7 @@ class RegistrationController extends AbstractController /** @var string $plainPassword */ $plainPassword = $form->get('plainPassword')->getData(); + $user->setRoles(['ROLE_EMPLOYEE']); // encode the plain password $user->setPassword($userPasswordHasher->hashPassword($user, $plainPassword)); diff --git a/src/Entity/UserApp.php b/src/Entity/UserApp.php index 8f87ba6..7dabaa2 100644 --- a/src/Entity/UserApp.php +++ b/src/Entity/UserApp.php @@ -29,7 +29,7 @@ class UserApp implements UserInterface, PasswordAuthenticatedUserInterface * @var list The user roles */ #[ORM\Column] - private array $roles = ["ROLE_USER"]; + private array $roles = []; /** * @var string The hashed password