@@ -21,7 +21,8 @@ sections:
2121#. Fetching the current User object.
2222
2323These are followed by a number of small (but still captivating) sections,
24- like :ref: `logging out <book-security-logging-out >` and :ref: `encoding user passwords <security-encoding-password >`.
24+ like :ref: `logging out <book-security-logging-out >` and
25+ :ref: `encoding user passwords <security-encoding-password >`.
2526
2627.. _book-security-firewalls :
2728
@@ -362,6 +363,11 @@ probably only need one. If you *do* have multiple, you can configure which
362363*one * provider to use for your firewall under its ``provider `` key (e.g.
363364``provider: in_memory ``).
364365
366+ .. seealso ::
367+
368+ See :doc: `/cookbook/security/multiple_user_providers ` for
369+ all the details about multiple providers setup.
370+
365371Try to login using username ``admin `` and password ``kitten ``. You should
366372see an error!
367373
@@ -666,11 +672,11 @@ Add Code to Deny Access
666672
667673There are **two ** ways to deny access to something:
668674
669- 1) :ref: `access_control in security.yml <security-authorization-access-control >`
675+ #. :ref: `access_control in security.yml <security-authorization-access-control >`
670676 allows you to protect URL patterns (e.g. ``/admin/* ``). This is easy,
671677 but less flexible;
672678
673- 2) :ref: `in your code via the security.authorization_checker service <book-security-securing-controller >`.
679+ #. :ref: `in your code via the security.authorization_checker service <book-security-securing-controller >`.
674680
675681.. _security-authorization-access-control :
676682
@@ -838,8 +844,10 @@ In both cases, a special
838844is thrown, which ultimately triggers a 403 HTTP response inside Symfony.
839845
840846That's it! If the user isn't logged in yet, they will be asked to login (e.g.
841- redirected to the login page). If they *are * logged in, they'll be shown
842- the 403 access denied page (which you can :ref: `customize <cookbook-error-pages-by-status-code >`).
847+ redirected to the login page). If they *are * logged in, but do *not * have the
848+ ``ROLE_ADMIN `` role, they'll be shown the 403 access denied page (which you can
849+ :ref: `customize <cookbook-error-pages-by-status-code >`). If they are logged in
850+ and have the correct roles, the code will be executed.
843851
844852.. _book-security-securing-controller-annotations :
845853
@@ -881,14 +889,13 @@ the built-in helper function:
881889 <a href="...">Delete</a>
882890 <?php endif ?>
883891
884- If you use this function and are *not * behind a firewall, an exception
885- will be thrown. Again, it's almost always a good
886- idea to have a main firewall that covers all URLs (as has been shown
887- in this chapter).
892+ If you use this function and you are *not * behind a firewall, an exception will
893+ be thrown. Again, it's almost always a good idea to have a main firewall that
894+ covers all URLs (as shown before in this chapter).
888895
889896.. caution ::
890897
891- Be careful with this in your layout or on your error pages! Because of
898+ Be careful with this in your base layout or on your error pages! Because of
892899 some internal Symfony details, to avoid broken error pages in the ``prod ``
893900 environment, wrap calls in these templates with a check for ``app.user ``:
894901
@@ -899,10 +906,10 @@ in this chapter).
899906Securing other Services
900907.......................
901908
902- In fact, anything in Symfony can be protected by doing something similar
903- to this . For example, suppose you have a service (i.e. a PHP class) whose
904- job is to send emails. You can restrict use of this class - no matter where
905- it's being used from - to only certain users.
909+ Anything in Symfony can be protected by doing something similar to the code
910+ used to secure a controller . For example, suppose you have a service (i.e. a
911+ PHP class) whose job is to send emails. You can restrict use of this class - no
912+ matter where it's being used from - to only certain users.
906913
907914For more information see :doc: `/cookbook/security/securing_services `.
908915
@@ -911,7 +918,8 @@ Checking to see if a User is Logged In (IS_AUTHENTICATED_FULLY)
911918
912919So far, you've checked access based on roles - those strings that start with
913920``ROLE_ `` and are assigned to users. But if you *only * want to check if a
914- user is logged in (you don't care about roles), then you can see ``IS_AUTHENTICATED_FULLY ``::
921+ user is logged in (you don't care about roles), then you can use
922+ ``IS_AUTHENTICATED_FULLY ``::
915923
916924 // ...
917925
@@ -1026,6 +1034,7 @@ Now you can call whatever methods are on *your* User object. For example,
10261034if your User object has a ``getFirstName() `` method, you could use that::
10271035
10281036 use Symfony\Component\HttpFoundation\Response;
1037+ // ...
10291038
10301039 public function indexAction()
10311040 {
@@ -1359,7 +1368,7 @@ configuration tree may be useful.
13591368
13601369Good luck!
13611370
1362- Learn more from the Cookbook
1371+ Learn More from the Cookbook
13631372----------------------------
13641373
13651374* :doc: `Forcing HTTP/HTTPS </cookbook/security/force_https >`
0 commit comments