Skip to content

Commit 46fcb67

Browse files
committed
minor #4218 Caution that roles should start with ROLE_ (jrjohnson)
This PR was merged into the 2.3 branch. Discussion ---------- Caution that roles should start with ROLE_ In order to save someone else a few hours of frustration make it clear that the ROLE_ preface is not just for show. | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | all | Fixed tickets | Commits ------- 749996b Fix reference label f856641 Add label book-security-roles 9d13930 Add formatting, links, and clarity 1522de7 Caution that roles should start with ROLE_
2 parents 78eea60 + 749996b commit 46fcb67

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

book/security.rst

+2
Original file line numberDiff line numberDiff line change
@@ -1652,6 +1652,8 @@ the default for the firewall as a whole).
16521652
For more information about user provider and firewall configuration, see
16531653
the :doc:`/reference/configuration/security`.
16541654

1655+
.. _book-security-roles:
1656+
16551657
Roles
16561658
-----
16571659

cookbook/security/entity_provider.rst

+8
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,14 @@ about in this section.
651651
If you fail to return any roles, it may appear as if your user isn't
652652
authenticated at all.
653653

654+
.. caution::
655+
656+
In order to work with the security configuration examples on this page
657+
all roles must be prefixed with ``ROLE_`` (see
658+
the :ref:`section about roles <book-security-roles>` in the book). For
659+
example, your roles will be ``ROLE_ADMIN`` or ``ROLE_USER`` instead of
660+
``ADMIN`` or ``USER``.
661+
654662
In this example, the ``AcmeUserBundle:User`` entity class defines a
655663
many-to-many relationship with a ``AcmeUserBundle:Role`` entity class.
656664
A user can be related to several roles and a role can be composed of

0 commit comments

Comments
 (0)