File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
DependencyInjection/Compiler Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1414use Symfony \Component \DependencyInjection \Reference ;
1515use Symfony \Component \DependencyInjection \ContainerBuilder ;
1616use Symfony \Component \DependencyInjection \Compiler \CompilerPassInterface ;
17+ use Symfony \Component \DependencyInjection \Exception \LogicException ;
1718
1819/**
1920 * Adds all configured security voters to the access decision manager.
@@ -40,6 +41,10 @@ public function process(ContainerBuilder $container)
4041 $ voters = iterator_to_array ($ voters );
4142 ksort ($ voters );
4243
43- $ container ->getDefinition ('security.access.decision_manager ' )->replaceArgument (0 , array_values ($ voters ));
44+ if (!$ voters ) {
45+ throw new LogicException ('No security voters found. You need to tag at least one with "security.voter" ' );
46+ }
47+
48+ $ container ->getDefinition ('security.access.decision_manager ' )->addMethodCall ('setVoters ' , array (array_values ($ voters )));
4449 }
4550}
Original file line number Diff line number Diff line change 1717 ],
1818 "require" : {
1919 "php" : " >=5.3.9" ,
20- "symfony/security" : " ~2.7 |~3.0.0" ,
20+ "symfony/security" : " ~2.8 |~3.0.0" ,
2121 "symfony/http-kernel" : " ~2.2|~3.0.0"
2222 },
2323 "require-dev" : {
You can’t perform that action at this time.
0 commit comments