Skip to content

Instantly share code, notes, and snippets.

@Invis1ble
Last active Nov 23, 2017
Embed
What would you like to do?
Disable Symfony 3.3 AclVoter
<?php
namespace AppBundle;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use AppBundle\DependencyInjection\Compiler\DisableAclVoterPass;
class AppBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
parent::build($container);
$container->addCompilerPass(new DisableAclVoterPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 1);
}
}
<?php
namespace AppBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class DisableAclVoterPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
{
$container->findDefinition('security.acl.voter.basic_permissions')
->clearTag('security.voter')
;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment