[Security] Implemented the Serializable interface in the Role class
This commit is contained in:
parent
28abff8147
commit
b55930a45b
|
@ -4,6 +4,7 @@ CHANGELOG
|
|||
2.1.0
|
||||
-----
|
||||
|
||||
* Added the Serializable interface on the Role class
|
||||
* [BC BREAK] The signature of ExceptionListener has changed
|
||||
* changed the HttpUtils constructor signature to take a UrlGenerator and a UrlMatcher instead of a Router
|
||||
* EncoderFactoryInterface::getEncoder() can now also take a class name as an argument
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace Symfony\Component\Security\Core\Role;
|
|||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class Role implements RoleInterface
|
||||
class Role implements RoleInterface, \Serializable
|
||||
{
|
||||
private $role;
|
||||
|
||||
|
@ -38,4 +38,20 @@ class Role implements RoleInterface
|
|||
{
|
||||
return $this->role;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function serialize()
|
||||
{
|
||||
return serialize($this->role);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function unserialize($serialized)
|
||||
{
|
||||
$this->role = unserialize($serialized);
|
||||
}
|
||||
}
|
||||
|
|
Reference in New Issue