User: Add ROLE_ANONYMOUS when anonymous user is created - refs BT#21198

pull/5003/head
christian 1 year ago
parent d8bb1b8d02
commit 7d1135668d
  1. 3
      src/CoreBundle/EventSubscriber/AnonymousUserSubscriber.php

@ -128,7 +128,8 @@ class AnonymousUserSubscriber implements EventSubscriberInterface
->setPlainPassword('anon')
->setEmail('anon_' . $uniqueId . '@localhost.local')
->setOfficialCode('anonymous')
->setCreatorId(1);
->setCreatorId(1)
->addRole('ROLE_ANONYMOUS');
$this->entityManager->persist($anonymousUser);
$this->entityManager->flush();

Loading…
Cancel
Save