From cb9bee8b7437628fafd3518bd6674d4aad2444e0 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 14 Feb 2017 13:23:04 +0100 Subject: [PATCH] Replaced tabs with white spaces --- best_practices/security.rst | 17 +++++++-------- doctrine/custom_dql_functions.rst | 24 ++++++++++---------- security/access_denied_handler.rst | 35 +++++++++++++++--------------- 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/best_practices/security.rst b/best_practices/security.rst index 621a33c96dc..7280f133edc 100644 --- a/best_practices/security.rst +++ b/best_practices/security.rst @@ -235,16 +235,15 @@ more advanced use-case, you can always do the same security check in PHP: if (!$post->isAuthor($this->getUser())) { $this->denyAccessUnlessGranted('edit', $post); - - // or without the shortcut: - // - // use Symfony\Component\Security\Core\Exception\AccessDeniedException; - // ... - // - // if (!$this->get('security.authorization_checker')->isGranted('edit', $post)) { - // throw $this->createAccessDeniedException(); - // } } + // equivalent code without using the "denyAccessUnlessGranted()" shortcut: + // + // use Symfony\Component\Security\Core\Exception\AccessDeniedException; + // ... + // + // if (!$this->get('security.authorization_checker')->isGranted('edit', $post)) { + // throw $this->createAccessDeniedException(); + // } // ... } diff --git a/doctrine/custom_dql_functions.rst b/doctrine/custom_dql_functions.rst index c078f8b1f83..415907fdd06 100644 --- a/doctrine/custom_dql_functions.rst +++ b/doctrine/custom_dql_functions.rst @@ -82,18 +82,18 @@ In Symfony, you can register your custom DQL functions as follows: .. configuration-block:: - .. code-block:: yaml - - # app/config/config.yml - doctrine: - orm: - # ... - entity_managers: - example_manager: - # Place your functions here - dql: - datetime_functions: - test_datetime: AppBundle\DQL\DatetimeFunction + .. code-block:: yaml + + # app/config/config.yml + doctrine: + orm: + # ... + entity_managers: + example_manager: + # Place your functions here + dql: + datetime_functions: + test_datetime: AppBundle\DQL\DatetimeFunction .. code-block:: xml diff --git a/security/access_denied_handler.rst b/security/access_denied_handler.rst index 213bed3529d..43bf24187dd 100644 --- a/security/access_denied_handler.rst +++ b/security/access_denied_handler.rst @@ -40,7 +40,7 @@ Each firewall context can define its own custom access denied handler: )); -Your handler must implement the +Your handler must implement the :class:`Symfony\\Component\\Security\\Http\\Authorization\\AccessDeniedHandlerInterface`. This interface defines one method called ``handle()`` that implements the logic to execute when access is denied to the current user (send a mail, log a message, or @@ -78,25 +78,26 @@ Then, register the service for the access denied handler: .. code-block:: xml - - - + + + - - - - + + + + .. code-block:: php - // app/config/services.php - $container->register( + // app/config/services.php + $container->register( 'app.security.access_denied_handler', - 'AppBundle\Security\AccessDeniedHandler' - ); + 'AppBundle\Security\AccessDeniedHandler' + ); -That's it! Any ``AccessDeniedException`` thrown by the ``foo`` firewall will now be handled by your service. +That's it! Any ``AccessDeniedException`` thrown by the ``foo`` firewall will now +be handled by your service.