IntegrationPass.php 731B

12345678910111213141516171819202122
  1. <?php
  2. namespace JMS\SecurityExtraBundle\DependencyInjection\Compiler;
  3. use Symfony\Component\DependencyInjection\ContainerBuilder;
  4. use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
  5. class IntegrationPass implements CompilerPassInterface
  6. {
  7. public function process(ContainerBuilder $container)
  8. {
  9. if (!$container->hasAlias('security.acl.provider')
  10. && !$container->hasDefinition('security.acl.provider')) {
  11. $container->removeDefinition('security.acl.permission_evaluator');
  12. }
  13. if ($container->hasDefinition('security.role_hierarchy')) {
  14. $container->getDefinition('security.role_hierarchy')
  15. ->setPublic(true);
  16. }
  17. }
  18. }