diff --git a/book/security.rst b/book/security.rst index c4f259c874f..a2fb093e373 100644 --- a/book/security.rst +++ b/book/security.rst @@ -1652,6 +1652,8 @@ the default for the firewall as a whole). For more information about user provider and firewall configuration, see the :doc:`/reference/configuration/security`. +.. _book-security-roles: + Roles ----- diff --git a/cookbook/security/entity_provider.rst b/cookbook/security/entity_provider.rst index 5943ea396c5..ae32cc78a4c 100644 --- a/cookbook/security/entity_provider.rst +++ b/cookbook/security/entity_provider.rst @@ -651,6 +651,14 @@ about in this section. If you fail to return any roles, it may appear as if your user isn't authenticated at all. +.. caution:: + + In order to work with the security configuration examples on this page + all roles must be prefixed with ``ROLE_`` (see + the :ref:`section about roles ` in the book). For + example, your roles will be ``ROLE_ADMIN`` or ``ROLE_USER`` instead of + ``ADMIN`` or ``USER``. + In this example, the ``AcmeUserBundle:User`` entity class defines a many-to-many relationship with a ``AcmeUserBundle:Role`` entity class. A user can be related to several roles and a role can be composed of