mirror of
https://github.com/symfony/symfony-docs.git
synced 2026-03-23 16:22:10 +01:00
Merge branch '6.4' into 7.3
* 6.4: Minor tweak [Security] abstract voter implements CacheableVoterInterface
This commit is contained in:
@@ -49,11 +49,19 @@ which makes creating a voter even easier::
|
||||
abstract protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token, ?Vote $vote = null): bool;
|
||||
}
|
||||
|
||||
|
||||
.. versionadded:: 7.3
|
||||
|
||||
|
||||
The ``$vote`` argument of the ``voteOnAttribute()`` method was introduced
|
||||
in Symfony 7.3.
|
||||
|
||||
.. note::
|
||||
|
||||
The Voter class also implements
|
||||
:class:`Symfony\\Component\\Security\\Core\\Authorization\\Voter\\CacheableVoterInterface`
|
||||
with methods used to improve :ref:`voting performance <voter-improve-performance>`
|
||||
thanks to caching.
|
||||
|
||||
.. _how-to-use-the-voter-in-a-controller:
|
||||
|
||||
Setup: Checking for Access in a Controller
|
||||
@@ -302,6 +310,8 @@ If you're using the :ref:`default services.yaml configuration <service-container
|
||||
you're done! Symfony will automatically pass the ``security.helper``
|
||||
service when instantiating your voter (thanks to autowiring).
|
||||
|
||||
.. _voter-improve-performance:
|
||||
|
||||
Improving Voter Performance
|
||||
---------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user