Skip to content

Add documentation about CacheableVoterInterface #16039

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions security/voters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ which makes creating a voter even easier::

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

.. tip::

Checking each voter several times can be time consumming for applications
that perform a lot of permission checks. However, when a voter implements
the :class:`Symfony\\Component\\Security\\Core\\Authorization\\Voter\\CacheableVoterInterface`,
the access decision manager, will remember the attribute and type of subject
supported by the voter, and will, next, only call the involved voters.

.. versionadded:: 5.4

The ``CacheableVoterInterface`` interface was introduced in Symfony 5.4.

Setup: Checking for Access in a Controller
------------------------------------------

Expand Down