Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit920b330

Browse files
committed
Merge pull requestsymfony#2541 from m14t/roleVsRoleInterfaceBug
Fix custom Roles in entity_provider cookbook.
2 parents1b4c4bd +dd04a2e commit920b330

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

‎cookbook/security/entity_provider.rst‎

Lines changed: 3 additions & 4 deletions
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 Groupimplements RoleInterface
608+
class Groupextends Role
610609
{
611610
/**
612611
* @ORM\Column(name="id", type="integer")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp