Skip to content

Commit 5f7aff5

Browse files
committed
minor #13961 [Security] Mention the feature to use a custom AccessDecisionManager (javiereguiluz)
This PR was squashed before being merged into the 3.4 branch. Discussion ---------- [Security] Mention the feature to use a custom AccessDecisionManager Fixes #8149. Commits ------- 51ae3a5 [Security] Mention the feature to use a custom AccessDecisionManager
2 parents e5e89c9 + 51ae3a5 commit 5f7aff5

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

security/voters.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,3 +323,49 @@ security configuration:
323323
'allow_if_all_abstain' => false,
324324
],
325325
]);
326+
327+
Custom Access Decision Strategy
328+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
329+
330+
If none of the built-in strategies fits your use case, define the ``service``
331+
option to use a custom service as the Access Decision Manager (your service
332+
must implement the :class:`Symfony\\Component\\Security\\Core\\Authorization\\AccessDecisionManagerInterface`):
333+
334+
.. configuration-block::
335+
336+
.. code-block:: yaml
337+
338+
# app/config/security.yml
339+
security:
340+
access_decision_manager:
341+
service: App\Security\MyCustomAccessDecisionManager
342+
# ...
343+
344+
.. code-block:: xml
345+
346+
<!-- app/config/security.xml -->
347+
<?xml version="1.0" encoding="UTF-8" ?>
348+
<srv:container xmlns="http://symfony.com/schema/dic/security"
349+
xmlns:srv="http://symfony.com/schema/dic/services"
350+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
351+
xsi:schemaLocation="http://symfony.com/schema/dic/services
352+
https://symfony.com/schema/dic/services/services-1.0.xsd"
353+
>
354+
355+
<config>
356+
<access-decision-manager
357+
service="App\Security\MyCustomAccessDecisionManager"/>
358+
</config>
359+
</srv:container>
360+
361+
.. code-block:: php
362+
363+
// app/config/security.php
364+
use App\Security\MyCustomAccessDecisionManager;
365+
366+
$container->loadFromExtension('security', [
367+
'access_decision_manager' => [
368+
'service' => MyCustomAccessDecisionManager::class,
369+
// ...
370+
],
371+
]);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy