[SecurityBundle] fixed DebugAccessDecisionManager config
This commit is contained in:
parent
db208e3e25
commit
53c78fe93b
@ -45,10 +45,10 @@ class AddSecurityVotersPass implements CompilerPassInterface
|
||||
throw new LogicException('No security voters found. You need to tag at least one with "security.voter"');
|
||||
}
|
||||
|
||||
$container->getDefinition('security.access.decision_manager')->addMethodCall('setVoters', array(array_values($voters)));
|
||||
|
||||
if ($container->hasDefinition('debug.security.access.decision_manager')) {
|
||||
$container->getDefinition('debug.security.access.decision_manager')->addMethodCall('setVoters', array(array_values($voters)));
|
||||
}
|
||||
$adm = $container->hasDefinition('debug.security.access.decision_manager')
|
||||
? $container->getDefinition('debug.security.access.decision_manager')
|
||||
: $container->getDefinition('security.access.decision_manager')
|
||||
;
|
||||
$adm->addMethodCall('setVoters', array(array_values($voters)));
|
||||
}
|
||||
}
|
||||
|
@ -66,6 +66,10 @@ class SecurityExtension extends Extension
|
||||
$loader->load('collectors.xml');
|
||||
$loader->load('guard.xml');
|
||||
|
||||
if ($container->hasParameter('kernel.debug') && $container->getParameter('kernel.debug')) {
|
||||
$loader->load('security_debug.xml');
|
||||
}
|
||||
|
||||
if (!class_exists('Symfony\Component\ExpressionLanguage\ExpressionLanguage')) {
|
||||
$container->removeDefinition('security.expression_language');
|
||||
$container->removeDefinition('security.access.expression_voter');
|
||||
@ -97,13 +101,6 @@ class SecurityExtension extends Extension
|
||||
$this->aclLoad($config['acl'], $container);
|
||||
}
|
||||
|
||||
if ($container->hasParameter('kernel.debug') && $container->getParameter('kernel.debug')) {
|
||||
$loader->load('security_debug.xml');
|
||||
|
||||
$definition = $container->findDefinition('security.authorization_checker');
|
||||
$definition->replaceArgument(2, new Reference('debug.security.access.decision_manager'));
|
||||
}
|
||||
|
||||
// add some required classes for compilation
|
||||
$this->addClassesToCompile(array(
|
||||
'Symfony\Component\Security\Http\Firewall',
|
||||
|
@ -61,6 +61,7 @@ class DebugAccessDecisionManager implements AccessDecisionManagerInterface
|
||||
public function setVoters(array $voters)
|
||||
{
|
||||
$this->voters = $voters;
|
||||
$this->manager->setVoters($voters);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user