roles
This commit is contained in:
parent
95aca509fc
commit
fc222f516c
31
migrations/Version20241121151633.php
Normal file
31
migrations/Version20241121151633.php
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated Migration: Please modify to your needs!
|
||||||
|
*/
|
||||||
|
final class Version20241121151633 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this up() migration is auto-generated, please modify it to your needs
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this down() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('CREATE SCHEMA public');
|
||||||
|
}
|
||||||
|
}
|
@ -28,6 +28,7 @@ class RegistrationController extends AbstractController
|
|||||||
/** @var string $plainPassword */
|
/** @var string $plainPassword */
|
||||||
$plainPassword = $form->get('plainPassword')->getData();
|
$plainPassword = $form->get('plainPassword')->getData();
|
||||||
|
|
||||||
|
$user->setRoles(['ROLE_INTERN']);
|
||||||
// encode the plain password
|
// encode the plain password
|
||||||
$user->setPassword($userPasswordHasher->hashPassword($user, $plainPassword));
|
$user->setPassword($userPasswordHasher->hashPassword($user, $plainPassword));
|
||||||
|
|
||||||
@ -55,6 +56,7 @@ class RegistrationController extends AbstractController
|
|||||||
/** @var string $plainPassword */
|
/** @var string $plainPassword */
|
||||||
$plainPassword = $form->get('plainPassword')->getData();
|
$plainPassword = $form->get('plainPassword')->getData();
|
||||||
|
|
||||||
|
$user->setRoles(['ROLE_EMPLOYEE']);
|
||||||
// encode the plain password
|
// encode the plain password
|
||||||
$user->setPassword($userPasswordHasher->hashPassword($user, $plainPassword));
|
$user->setPassword($userPasswordHasher->hashPassword($user, $plainPassword));
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ class UserApp implements UserInterface, PasswordAuthenticatedUserInterface
|
|||||||
* @var list<string> The user roles
|
* @var list<string> The user roles
|
||||||
*/
|
*/
|
||||||
#[ORM\Column]
|
#[ORM\Column]
|
||||||
private array $roles = ["ROLE_USER"];
|
private array $roles = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string The hashed password
|
* @var string The hashed password
|
||||||
|
Loading…
Reference in New Issue
Block a user