Skip to content

Commit cb8ba00

Browse files
committed
Add documentation about CacheableVoterInterface
1 parent b41319b commit cb8ba00

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

security/voters.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ which makes creating a voter even easier::
6262

6363
.. _how-to-use-the-voter-in-a-controller:
6464

65+
.. tip::
66+
67+
Checking each voter several times can be time consumming for applications
68+
that perform a lot of permission checks. However, when a voter implements
69+
the :class:`Symfony\\Component\\Security\\Core\\Authorization\\Voter\\CacheableVoterInterface`,
70+
the access decision manager, will remember the attribute and type of subject
71+
supported by the voter, and will, next, only call the involved voters.
72+
73+
.. versionadded:: 5.4
74+
75+
The ``CacheableVoterInterface`` interface was introduced in Symfony 5.4.
76+
6577
Setup: Checking for Access in a Controller
6678
------------------------------------------
6779

0 commit comments

Comments
 (0)