From c254f35b70d16067e5e71793cc0857be96616f05 Mon Sep 17 00:00:00 2001 From: Julien Humbert Date: Thu, 12 Jul 2018 21:40:33 +0200 Subject: [PATCH 1/2] Remove deleted RoleInterface As the master branch of symfony/symfony deleted the Symfony\Component\Security\Core\Role\RoleInterface as of 4.0, this update remove the interface to only mention the base class. --- components/security/authorization.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/security/authorization.rst b/components/security/authorization.rst index cb606bc7a3a..2544c751115 100644 --- a/components/security/authorization.rst +++ b/components/security/authorization.rst @@ -168,8 +168,8 @@ Roles ----- Roles are objects that give expression to a certain right the user has. -The only requirement is that they implement :class:`Symfony\\Component\\Security\\Core\\Role\\RoleInterface`, -which means they should also have a :method:`Symfony\\Component\\Security\\Core\\Role\\RoleInterface::getRole` +The only requirement is that they extend :class:`Symfony\\Component\\Security\\Core\\Role\\Role`, +which means they have a :method:`Symfony\\Component\\Security\\Core\\Role\\Role::getRole` method that returns a string representation of the role itself. The default :class:`Symfony\\Component\\Security\\Core\\Role\\Role` simply returns its first constructor argument:: From e4a289e958a0f5e08b83097eaac5b2ef5d56c6aa Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sat, 14 Jul 2018 09:18:01 +0200 Subject: [PATCH 2/2] Reword --- components/security/authorization.rst | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/components/security/authorization.rst b/components/security/authorization.rst index 2544c751115..685df577126 100644 --- a/components/security/authorization.rst +++ b/components/security/authorization.rst @@ -167,12 +167,11 @@ role:: Roles ----- -Roles are objects that give expression to a certain right the user has. -The only requirement is that they extend :class:`Symfony\\Component\\Security\\Core\\Role\\Role`, -which means they have a :method:`Symfony\\Component\\Security\\Core\\Role\\Role::getRole` -method that returns a string representation of the role itself. The default -:class:`Symfony\\Component\\Security\\Core\\Role\\Role` simply returns its -first constructor argument:: +Roles are objects that give expression to a certain right the user has. The only +requirement is that they must define a ``getRole()`` method that returns a +string representation of the role itself. To do so, you can optionally extend +from the default :class:`Symfony\\Component\\Security\\Core\\Role\\Role` class, +which returns its first constructor argument in this method:: use Symfony\Component\Security\Core\Role\Role;