Skip to content

Commit ff2addc

Browse files
committed
bug symfony#16734 Make sure security.role_hierarchy.roles always exists (WouterJ)
This PR was squashed before being merged into the 2.8 branch (closes symfony#16734). Discussion ---------- Make sure security.role_hierarchy.roles always exists | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#16731 | License | MIT | Doc PR | - Commits ------- b272ab5 Make sure security.role_hierarchy.roles always exists
2 parents 6ae61f6 + b272ab5 commit ff2addc

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
<parameter key="security.validator.user_password.class">Symfony\Component\Security\Core\Validator\Constraints\UserPasswordValidator</parameter>
4848

4949
<parameter key="security.expression_language.class">Symfony\Component\Security\Core\Authorization\ExpressionLanguage</parameter>
50+
<parameter key="security.role_hierarchy.roles" type="collection" />
5051
</parameters>
5152

5253
<services>

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,7 @@ public function testDisableRoleHierarchyVoter()
115115

116116
$container->compile();
117117

118-
$admDefinition = $container->getDefinition('security.access.decision_manager');
119-
$registeredVoters = array_map('strval', $admDefinition->getArgument(0));
120-
121-
$this->assertNotContains('security.access.role_hierarchy_voter', $registeredVoters);
118+
$this->assertFalse($container->hasDefinition('security.access.role_hierarchy_voter'));
122119
}
123120

124121
protected function getRawContainer()

0 commit comments

Comments
 (0)