Commit a50ba322 authored by Fabien Potencier's avatar Fabien Potencier

fixed CS

parent 38ca05e1
......@@ -4,6 +4,7 @@ Changelog
2.3.0 (2018-XX-XX)
------------------
* added support for ServiceIterator in Security provider for voters
* fixed error when HttpKernelRuntime is not available
* allow setting custom status code on exception response with Symfony 3.3+
* made CSRF extension work with Validator translations domain
......
......@@ -686,15 +686,14 @@ Symfony `cookbook`_.
providers. :doc:`How to Create a Custom Authentication System with Guard
</cookbook/guard_authentication>`
Using Voters to check user permissions
Using Voters to check User Permissions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
See the `Security component documentation on voters <http://symfony.com/doc/current/security/voters.html>`_.
By default Silex includes the role hierarchy and authenticated voters.
If you want to add a custom voter, you need to register it as a service and extend ``security.voter_services``.
.. code-block:: php
By default Silex includes the role hierarchy and authenticated voters. If you
want to add a custom voter, you need to register it as a service and extend
``security.voter_services``::
$app['custom_voter'] = function () {
return MyCustomVoter();
......@@ -707,8 +706,9 @@ If you want to add a custom voter, you need to register it as a service and exte
});
.. note::
Using the above approach with the service names circular references are avoided
and you can use the ``AccessDecisionManager`` in your custom voter
Using the above approach with the service names, circular references are
avoided and you can use the ``AccessDecisionManager`` in your custom voter
to `check for roles inside a voter
<http://symfony.com/doc/current/security/voters.html#checking-for-roles-inside-a-voter>`_.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment