vendor/sulu/sulu/src/Sulu/Bundle/SecurityBundle/SuluSecurityBundle.php line 27

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of Sulu.
  4.  *
  5.  * (c) Sulu GmbH
  6.  *
  7.  * This source file is subject to the MIT license that is bundled
  8.  * with this source code in the file LICENSE.
  9.  */
  10. namespace Sulu\Bundle\SecurityBundle;
  11. use Sulu\Bundle\PersistenceBundle\PersistenceBundleTrait;
  12. use Sulu\Bundle\SecurityBundle\DependencyInjection\Compiler\AccessControlProviderPass;
  13. use Sulu\Bundle\SecurityBundle\DependencyInjection\Compiler\AliasForSecurityEncoderCompilerPass;
  14. use Sulu\Component\Security\Authentication\RoleInterface;
  15. use Sulu\Component\Security\Authentication\RoleSettingInterface;
  16. use Sulu\Component\Security\Authentication\UserInterface;
  17. use Sulu\Component\Security\Authorization\AccessControl\AccessControlInterface;
  18. use Symfony\Component\DependencyInjection\ContainerBuilder;
  19. use Symfony\Component\HttpKernel\Bundle\Bundle;
  20. /**
  21.  * @final
  22.  */
  23. class SuluSecurityBundle extends Bundle
  24. {
  25.     use PersistenceBundleTrait;
  26.     /**
  27.      * @internal
  28.      */
  29.     public function build(ContainerBuilder $container): void
  30.     {
  31.         $this->buildPersistence(
  32.             [
  33.                 UserInterface::class => 'sulu.model.user.class',
  34.                 RoleInterface::class => 'sulu.model.role.class',
  35.                 RoleSettingInterface::class => 'sulu.model.role_setting.class',
  36.                 AccessControlInterface::class => 'sulu.model.access_control.class',
  37.             ],
  38.             $container
  39.         );
  40.         $container->addCompilerPass(new AccessControlProviderPass());
  41.         $container->addCompilerPass(new AliasForSecurityEncoderCompilerPass());
  42.         parent::build($container);
  43.     }
  44. }