Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit51ae3a5

Browse files
committed
[Security] Mention the feature to use a custom AccessDecisionManager
1 parente5e89c9 commit51ae3a5

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:containerxmlns="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)

[8]ページ先頭

©2009-2025 Movatter.jp