8000 Caution that roles should start with ROLE_ · symfony/symfony-docs@1522de7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1522de7

Browse files
committed
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.
1 parent 7cbad6d commit 1522de7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cookbook/security/entity_provider.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,11 @@ 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+
The default role voter requires that all of the roles returned should be prefaced by ROLE_.
657+
Example ROLE_ADMIN, ROLE_USER; not just ADMIN or USER.
658+
654659
In this example, the ``AcmeUserBundle:User`` entity class defines a
655660
many-to-many relationship with a ``AcmeUserBundle:Role`` entity class.
656661
A user can be related to several roles and a role can be composed of

0 commit comments

Comments
 (0)
0