Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e97067f

Browse files
committed
Merge branch '7.4' into 8.0
* 7.4: Minor tweak [Security] abstract voter implements CacheableVoterInterface
2 parents ade7ddd + 3c83579 commit e97067f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

security/voters.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ which makes creating a voter even easier::
4949
abstract protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token, ?Vote $vote = null): bool;
5050
}
5151

52+
.. note::
53+
54+
The Voter class also implements
55+
:class:`Symfony\\Component\\Security\\Core\\Authorization\\Voter\\CacheableVoterInterface`
56+
with methods used to improve :ref:`voting performance <voter-improve-performance>`
57+
thanks to caching.
58+
5259
.. _how-to-use-the-voter-in-a-controller:
5360

5461
Setup: Checking for Access in a Controller
@@ -306,6 +313,8 @@ If you're using the :ref:`default services.yaml configuration <service-container
306313
you're done! Symfony will automatically pass the ``security.helper``
307314
service when instantiating your voter (thanks to autowiring).
308315

316+
.. _voter-improve-performance:
317+
309318
Improving Voter Performance
310319
---------------------------
311320

0 commit comments

Comments
 (0)