From d9fecfe2f451dcb846111a13dc232c6a026c231f Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 20 Dec 2016 10:19:03 +0100 Subject: [PATCH 1/2] Update voters.rst Made clear the difference between using denyAccessUnlessGranted and isGranted - the former is NOT just a shortcut to calling isGranted. --- security/voters.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/voters.rst b/security/voters.rst index ebfaf13b8a5..2b4e6ef81bb 100644 --- a/security/voters.rst +++ b/security/voters.rst @@ -98,8 +98,8 @@ decides this using whatever logic you want. The ``denyAccessUnlessGranted()`` and ``isGranted()`` functions are both just shortcuts of the ``Controller`` class to call ``isGranted()`` on - the ``security.authorization_checker`` service. - +   the ``security.authorization_checker`` service. ``denyAccessUnlessGranted()`` will throw an ``AccessDeniedException``, whereas ``isGranted()`` will return a boolean. + Creating the custom Voter ------------------------- From 57a8ca1965fe0dd5eb71cf81a6331dc6c0434680 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 21 Dec 2016 15:24:55 +0100 Subject: [PATCH 2/2] Minor reword --- security/voters.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/security/voters.rst b/security/voters.rst index 2b4e6ef81bb..6aa11d752eb 100644 --- a/security/voters.rst +++ b/security/voters.rst @@ -98,7 +98,9 @@ decides this using whatever logic you want. The ``denyAccessUnlessGranted()`` and ``isGranted()`` functions are both just shortcuts of the ``Controller`` class to call ``isGranted()`` on -   the ``security.authorization_checker`` service. ``denyAccessUnlessGranted()`` will throw an ``AccessDeniedException``, whereas ``isGranted()`` will return a boolean. +   the ``security.authorization_checker`` service. The main difference is that + when access is not granted, ``denyAccessUnlessGranted()`` throws an +    ``AccessDeniedException``, whereas ``isGranted()`` returns ``false``. Creating the custom Voter -------------------------