Skip to content

Commit 920b330

Browse files
committed
Merge pull request symfony#2541 from m14t/roleVsRoleInterfaceBug
Fix custom Roles in entity_provider cookbook.
2 parents 1b4c4bd + dd04a2e commit 920b330

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

cookbook/security/entity_provider.rst

+3-4
Original file line numberDiff line numberDiff line change
@@ -592,21 +592,20 @@ The ``AcmeUserBundle:Group`` entity class defines three table fields (``id``,
592592
``name`` and ``role``). The unique ``role`` field contains the role name used by
593593
the Symfony security layer to secure parts of the application. The most
594594
important thing to notice is that the ``AcmeUserBundle:Group`` entity class
595-
implements the :class:`Symfony\\Component\\Security\\Core\\Role\\RoleInterface`
596-
that forces it to have a ``getRole()`` method::
595+
extends the :class:`Symfony\\Component\\Security\\Core\\Role\\Role`::
597596
598597
// src/Acme/Bundle/UserBundle/Entity/Group.php
599598
namespace Acme\UserBundle\Entity;
600599
601-
use Symfony\Component\Security\Core\Role\RoleInterface;
600+
use Symfony\Component\Security\Core\Role\Role;
602601
use Doctrine\Common\Collections\ArrayCollection;
603602
use Doctrine\ORM\Mapping as ORM;
604603
605604
/**
606605
* @ORM\Table(name="acme_groups")
607606
* @ORM\Entity()
608607
*/
609-
class Group implements RoleInterface
608+
class Group extends Role
610609
{
611610
/**
612611
* @ORM\Column(name="id", type="integer")

0 commit comments

Comments
 (0)