Skip to content

Commit 2f005f1

Browse files
committed
minor #7279 Update voters.rst (ErikRoelofs, javiereguiluz)
This PR was submitted for the 3.2 branch but it was merged into the 2.8 branch instead (closes #7279). Discussion ---------- Update voters.rst Made clear the difference between using denyAccessUnlessGranted and isGranted - the former is not just a shortcut to calling isGranted. Commits ------- 4023044 Minor reword 188b654 Update voters.rst
2 parents be94483 + 4023044 commit 2f005f1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

security/voters.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,10 @@ decides this using whatever logic you want.
102102

103103
The ``denyAccessUnlessGranted()`` and ``isGranted()`` functions are both
104104
just shortcuts of the ``Controller`` class to call ``isGranted()`` on
105-
the ``security.authorization_checker`` service.
106-
105+
  the ``security.authorization_checker`` service. The main difference is that
106+
when access is not granted, ``denyAccessUnlessGranted()`` throws an
107+
   ``AccessDeniedException``, whereas ``isGranted()`` returns ``false``.
108+
107109
Creating the custom Voter
108110
-------------------------
109111

0 commit comments

Comments
 (0)