Skip to content

Commit 04ba588

Browse files
Merge branch '3.4' into 4.1
* 3.4: (21 commits) Added the Code of Conduct file do not override custom access decision configs [Security] Do not deauthenticate user when the first refreshed user has changed invalidate stale commits for PRs too add missing cache prefix seed attribute to XSD fix command description Fix class documentation [Validator] Add a missing translation [FrameworkBundle] Fix 3.4 tests [DI] fix dumping inline services again Fix phpdocs [EventDispatcher] Remove template method in test case Added LB translation for #27993 (UUID validator message translation) Replace deprecated validateValue with validate [FWBundle] Automatically enable PropertyInfo when using Flex [Process] fix locking of pipe files on Windows Correct PHPDoc type for float ttl bumped Symfony version to 3.4.18 updated VERSION for 3.4.17 updated CHANGELOG for 3.4.17 ...
2 parents be4456e + 94a483b commit 04ba588

File tree

5 files changed

+63
-5
lines changed

5 files changed

+63
-5
lines changed

DependencyInjection/MainConfiguration.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ public function getConfigTreeBuilder()
5858
return false;
5959
})
6060
->then(function ($v) {
61-
$v['access_decision_manager'] = array(
62-
'strategy' => AccessDecisionManager::STRATEGY_AFFIRMATIVE,
63-
);
61+
$v['access_decision_manager']['strategy'] = AccessDecisionManager::STRATEGY_AFFIRMATIVE;
6462

6563
return $v;
6664
})

Tests/DependencyInjection/CompleteConfigurationTest.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,11 +438,22 @@ public function testCustomAccessDecisionManagerService()
438438

439439
/**
440440
* @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
441-
* @expectedExceptionMessage "strategy" and "service" cannot be used together.
441+
* @expectedExceptionMessage Invalid configuration for path "security.access_decision_manager": "strategy" and "service" cannot be used together.
442442
*/
443443
public function testAccessDecisionManagerServiceAndStrategyCannotBeUsedAtTheSameTime()
444444
{
445-
$container = $this->getContainer('access_decision_manager_service_and_strategy');
445+
$this->getContainer('access_decision_manager_service_and_strategy');
446+
}
447+
448+
public function testAccessDecisionManagerOptionsAreNotOverriddenByImplicitStrategy()
449+
{
450+
$container = $this->getContainer('access_decision_manager_customized_config');
451+
452+
$accessDecisionManagerDefinition = $container->getDefinition('security.access.decision_manager');
453+
454+
$this->assertSame(AccessDecisionManager::STRATEGY_AFFIRMATIVE, $accessDecisionManagerDefinition->getArgument(1));
455+
$this->assertTrue($accessDecisionManagerDefinition->getArgument(2));
456+
$this->assertFalse($accessDecisionManagerDefinition->getArgument(3));
446457
}
447458

448459
/**
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
$container->loadFromExtension('security', array(
4+
'access_decision_manager' => array(
5+
'allow_if_all_abstain' => true,
6+
'allow_if_equal_granted_denied' => false,
7+
),
8+
'providers' => array(
9+
'default' => array(
10+
'memory' => array(
11+
'users' => array(
12+
'foo' => array('password' => 'foo', 'roles' => 'ROLE_USER'),
13+
),
14+
),
15+
),
16+
),
17+
'firewalls' => array(
18+
'simple' => array('pattern' => '/login', 'security' => false),
19+
),
20+
));
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<srv:container xmlns="http://symfony.com/schema/dic/security"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:srv="http://symfony.com/schema/dic/services"
5+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
6+
7+
<config>
8+
<access-decision-manager allow-if-all-abstain="true" allow-if-equal-granted-denied="false" />
9+
10+
<provider name="default">
11+
<memory>
12+
<user name="foo" password="foo" roles="ROLE_USER" />
13+
</memory>
14+
</provider>
15+
16+
<firewall name="simple" pattern="/login" security="false" />
17+
</config>
18+
</srv:container>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
security:
2+
access_decision_manager:
3+
allow_if_all_abstain: true
4+
allow_if_equal_granted_denied: false
5+
providers:
6+
default:
7+
memory:
8+
users:
9+
foo: { password: foo, roles: ROLE_USER }
10+
firewalls:
11+
simple: { pattern: /login, security: false }

0 commit comments

Comments
 (0)