Skip to content

Commit

Permalink
[Security] Implemented the Serializable interface in the Role class
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Jul 14, 2012
1 parent 28abff8 commit b55930a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Symfony/Component/Security/CHANGELOG.md
Expand Up @@ -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
Expand Down
18 changes: 17 additions & 1 deletion src/Symfony/Component/Security/Core/Role/Role.php
Expand Up @@ -17,7 +17,7 @@
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class Role implements RoleInterface
class Role implements RoleInterface, \Serializable
{
private $role;

Expand All @@ -38,4 +38,20 @@ public function getRole()
{
return $this->role;
}

/**
* {@inheritdoc}
*/
public function serialize()
{
return serialize($this->role);
}

/**
* {@inheritdoc}
*/
public function unserialize($serialized)
{
$this->role = unserialize($serialized);
}
}

0 comments on commit b55930a

Please sign in to comment.