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

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\Bundle\SecurityBundle\DependencyInjection\Compiler\TwoFactorCompilerPass;
  15. use Sulu\Component\Security\Authentication\RoleInterface;
  16. use Sulu\Component\Security\Authentication\RoleSettingInterface;
  17. use Sulu\Component\Security\Authentication\UserInterface;
  18. use Sulu\Component\Security\Authorization\AccessControl\AccessControlInterface;
  19. use Symfony\Component\DependencyInjection\ContainerBuilder;
  20. use Symfony\Component\HttpKernel\Bundle\Bundle;
  21. class SuluSecurityBundle extends Bundle
  22. {
  23.     use PersistenceBundleTrait;
  24.     public function build(ContainerBuilder $container)
  25.     {
  26.         $this->buildPersistence(
  27.             [
  28.                 UserInterface::class => 'sulu.model.user.class',
  29.                 RoleInterface::class => 'sulu.model.role.class',
  30.                 RoleSettingInterface::class => 'sulu.model.role_setting.class',
  31.                 AccessControlInterface::class => 'sulu.model.access_control.class',
  32.             ],
  33.             $container
  34.         );
  35.         $container->addCompilerPass(new AccessControlProviderPass());
  36.         $container->addCompilerPass(new AliasForSecurityEncoderCompilerPass());
  37.         $container->addCompilerPass(new TwoFactorCompilerPass());
  38.         parent::build($container);
  39.     }
  40. }