Skip to content

Commit

Permalink
Merge branch '2.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterj committed Jul 23, 2015
2 parents 6603c33 + 343b349 commit 2a30c19
Show file tree
Hide file tree
Showing 45 changed files with 1,134 additions and 513 deletions.
69 changes: 45 additions & 24 deletions book/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ configuration looks like this:
<firewall name="dev"
pattern="^/(_(profiler|wdt)|css|images|js)/"
security=false />
security="false" />
<firewall name="default">
<anonymous />
Expand All @@ -81,7 +81,7 @@ configuration looks like this:
$container->loadFromExtension('security', array(
'providers' => array(
'in_memory' => array(
'memory' => array(),
'memory' => null,
),
),
'firewalls' => array(
Expand Down Expand Up @@ -214,6 +214,8 @@ user to be logged in to access this URL:
# ...
firewalls:
# ...
default:
# ...
access_control:
# require ROLE_ADMIN for /admin*
Expand All @@ -236,10 +238,8 @@ user to be logged in to access this URL:
<!-- ... -->
</firewall>
<access-control>
<!-- require ROLE_ADMIN for /admin* -->
<rule path="^/admin" role="ROLE_ADMIN" />
</access-control>
<!-- require ROLE_ADMIN for /admin* -->
<rule path="^/admin" role="ROLE_ADMIN" />
</config>
</srv:container>
Expand Down Expand Up @@ -546,20 +546,23 @@ like this:
http://symfony.com/schema/dic/services/services-1.0.xsd">
<config>
<!-- ... -->
<provider name="in_memory">
<memory>
<user name="ryan" password="$2a$12$LCY0MefVIEc3TYPHV9SNnuzOfyr2p/AXIGoQJEDs4am4JwhNz/jli" roles="ROLE_USER" />
<user name="admin" password="$2a$12$cyTWeE9kpq1PjqKFiWUZFuCRPwVyAZwm4XzMZ1qPUFl7/flCM3V0G" roles="ROLE_ADMIN" />
</memory>
</provider>
<!-- ... -->
</config>
</srv:container>
.. code-block:: php
// app/config/security.php
$container->loadFromExtension('security', array(
// ...
'providers' => array(
'in_memory' => array(
'memory' => array(
Expand Down Expand Up @@ -699,8 +702,11 @@ URL pattern. You saw this earlier, where anything matching the regular expressio
# app/config/security.yml
security:
# ...
firewalls:
# ...
default:
# ...
access_control:
# require ROLE_ADMIN for /admin*
Expand All @@ -723,10 +729,8 @@ URL pattern. You saw this earlier, where anything matching the regular expressio
<!-- ... -->
</firewall>
<access-control>
<!-- require ROLE_ADMIN for /admin* -->
<rule path="^/admin" role="ROLE_ADMIN" />
</access-control>
<!-- require ROLE_ADMIN for /admin* -->
<rule path="^/admin" role="ROLE_ADMIN" />
</config>
</srv:container>
Expand All @@ -735,6 +739,7 @@ URL pattern. You saw this earlier, where anything matching the regular expressio
// app/config/security.php
$container->loadFromExtension('security', array(
// ...
'firewalls' => array(
// ...
'default' => array(
Expand Down Expand Up @@ -763,6 +768,7 @@ matches the URL.
# app/config/security.yml
security:
# ...
access_control:
- { path: ^/admin/users, roles: ROLE_SUPER_ADMIN }
- { path: ^/admin, roles: ROLE_ADMIN }
Expand All @@ -779,10 +785,9 @@ matches the URL.
<config>
<!-- ... -->
<access-control>
<rule path="^/admin/users" role="ROLE_SUPER_ADMIN" />
<rule path="^/admin" role="ROLE_ADMIN" />
</access-control>
<rule path="^/admin/users" role="ROLE_SUPER_ADMIN" />
<rule path="^/admin" role="ROLE_ADMIN" />
</config>
</srv:container>
Expand All @@ -791,6 +796,7 @@ matches the URL.
// app/config/security.php
$container->loadFromExtension('security', array(
// ...
'access_control' => array(
array('path' => '^/admin/users', 'role' => 'ROLE_SUPER_ADMIN'),
array('path' => '^/admin', 'role' => 'ROLE_ADMIN'),
Expand Down Expand Up @@ -1106,13 +1112,14 @@ the firewall can handle this automatically for you when you activate the
# app/config/security.yml
security:
# ...
firewalls:
secured_area:
# ...
logout:
path: /logout
target: /
# ...
.. code-block:: xml
Expand All @@ -1125,25 +1132,27 @@ the firewall can handle this automatically for you when you activate the
http://symfony.com/schema/dic/services/services-1.0.xsd">
<config>
<firewall name="secured_area" pattern="^/">
<!-- ... -->
<firewall name="secured_area">
<!-- ... -->
<logout path="/logout" target="/" />
</firewall>
<!-- ... -->
</config>
</srv:container>
.. code-block:: php
// app/config/security.php
$container->loadFromExtension('security', array(
// ...
'firewalls' => array(
'secured_area' => array(
// ...
'logout' => array('path' => 'logout', 'target' => '/'),
'logout' => array('path' => '/logout', 'target' => '/'),
),
),
// ...
));
Next, you'll need to create a route for this URL (but not a controller):
Expand All @@ -1154,7 +1163,7 @@ Next, you'll need to create a route for this URL (but not a controller):
# app/config/routing.yml
logout:
path: /logout
path: /logout
.. code-block:: xml
Expand All @@ -1175,7 +1184,7 @@ Next, you'll need to create a route for this URL (but not a controller):
use Symfony\Component\Routing\Route;
$collection = new RouteCollection();
$collection->add('logout', new Route('/logout', array()));
$collection->add('logout', new Route('/logout'));
return $collection;
Expand Down Expand Up @@ -1243,6 +1252,8 @@ rules by creating a role hierarchy:
# app/config/security.yml
security:
# ...
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
Expand All @@ -1258,6 +1269,8 @@ rules by creating a role hierarchy:
http://symfony.com/schema/dic/services/services-1.0.xsd">
<config>
<!-- ... -->
<role id="ROLE_ADMIN">ROLE_USER</role>
<role id="ROLE_SUPER_ADMIN">ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH</role>
</config>
Expand All @@ -1267,6 +1280,8 @@ rules by creating a role hierarchy:
// app/config/security.php
$container->loadFromExtension('security', array(
// ...
'role_hierarchy' => array(
'ROLE_ADMIN' => 'ROLE_USER',
'ROLE_SUPER_ADMIN' => array(
Expand Down Expand Up @@ -1296,6 +1311,8 @@ cookie will be ever created by Symfony):
# app/config/security.yml
security:
# ...
firewalls:
main:
http_basic: ~
Expand All @@ -1312,7 +1329,9 @@ cookie will be ever created by Symfony):
http://symfony.com/schema/dic/services/services-1.0.xsd">
<config>
<firewall stateless="true">
<!-- ... -->
<firewall name="main" stateless="true">
<http-basic />
</firewall>
</config>
Expand All @@ -1322,8 +1341,10 @@ cookie will be ever created by Symfony):
// app/config/security.php
$container->loadFromExtension('security', array(
// ...
'firewalls' => array(
'main' => array('http_basic' => array(), 'stateless' => true),
'main' => array('http_basic' => null, 'stateless' => true),
),
));
Expand Down
4 changes: 2 additions & 2 deletions components/console/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,8 @@ Calling a command from another one is straightforward::
'--yell' => true,
);

$input = new ArrayInput($arguments);
$returnCode = $command->run($input, $output);
$greetInput = new ArrayInput($arguments);
$returnCode = $command->run($greetInput, $output);

// ...
}
Expand Down
2 changes: 1 addition & 1 deletion components/expression_language/caching.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Both ``evaluate()`` and ``compile()`` can handle ``ParsedExpression`` and
$expression = new SerializedParsedExpression(
'1 + 4',
serialize($language->parse('1 + 4', array()))
serialize($language->parse('1 + 4', array())->getNodes())
);
var_dump($language->evaluate($expression)); // prints 5
Expand Down
1 change: 1 addition & 0 deletions cookbook/configuration/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ Configuration
apache_router
web_server_configuration
configuration_organization
mongodb_session_storage
Loading

0 comments on commit 2a30c19

Please sign in to comment.