Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Security] Implemented the Serializable interface in the Role class #4925

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 15, 2012

Conversation

stof
Copy link
Member

@stof stof commented Jul 14, 2012

The Role class is serialized in the session for each role of the user. Implementing the Serializable interface allows to reduce the size of the data.

@fabpot
Copy link
Member

fabpot commented Jul 15, 2012

This is a BC break for people extending the Role class and I'm not sure it is worth it:

Before:

1:{s:47:"\0Symfony\Component\Security\Core\Role\Role\0role";s:9:"ROLE_USER";}}

After:

16:{s:9:"ROLE_USER";}}

Length is 23 vs 79 for a role.

fabpot added a commit that referenced this pull request Jul 15, 2012
Commits
-------

1f2f866 fixed the serialization of the SwitchUserRole
b55930a [Security] Implemented the Serializable interface in the Role class

Discussion
----------

[Security] Implemented the Serializable interface in the Role class

The Role class is serialized in the session for each role of the user. Implementing the Serializable interface allows to reduce the size of the data.
@fabpot fabpot merged commit 1f2f866 into symfony:master Jul 15, 2012
@jalliot
Copy link
Contributor

jalliot commented Jul 15, 2012

@stof @fabpot The BC break should probably be mentioned in the UPGRADE file.

@fabpot
Copy link
Member

fabpot commented Jul 15, 2012

Oops, I did not want to merge it. I'm going to revert it now.

fabpot added a commit that referenced this pull request Jul 15, 2012
This reverts commit b0750f6, reversing
changes made to d09bfe7.
@stof
Copy link
Member Author

stof commented Jul 15, 2012

@fabpot are you rejecting the PR or only keeping it pending ? In the second case, a new PR will be needed as github does not allow reopening merged PRs

@fabpot
Copy link
Member

fabpot commented Jul 15, 2012

I'm -1 but let's the discussion continue on a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants