Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
a50ba322
Commit
a50ba322
authored
Feb 26, 2018
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed CS
parent
38ca05e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
doc/changelog.rst
doc/changelog.rst
+1
-0
doc/providers/security.rst
doc/providers/security.rst
+7
-7
No files found.
doc/changelog.rst
View file @
a50ba322
...
...
@@ -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
...
...
doc/providers/security.rst
View file @
a50ba322
...
...
@@ -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 p
ermissions
Using Voters to check
User P
ermissions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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>`_.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment