Skip to content

[Security] RoleHierarchy returns an unique array of roles #39852

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 1 commit into from
Jan 17, 2021

Conversation

lyrixx
Copy link
Member

@lyrixx lyrixx commented Jan 15, 2021

Q A
Branch? 5.x
Bug fix? no
New feature? yes: performance
Deprecations?
Tickets
License MIT
Doc PR

Speedup: https://github.com/symfony/symfony/blob/5.x/src/Symfony/Component/Security/Core/Authorization/Voter/RoleVoter.php#L48
BTW, why isn't an in_array() there?

@stof
Copy link
Member

stof commented Jan 15, 2021

BTW, why isn't an in_array() there?

legacy of the time where roles could be represented as objects compared by name.

@lyrixx lyrixx changed the title [Security] RoleHierarchy returns unique an unique array of roles [Security] RoleHierarchy returns an unique array of roles Jan 15, 2021
@stloyd
Copy link
Contributor

stloyd commented Jan 16, 2021

As mentioned by @stof, this should be most likely be deprecated and removed after that as it was not officially (from legacy point of view) dropped to not support objects (at least AFAIK, but I may be missing something 😉).

@fabpot
Copy link
Member

fabpot commented Jan 17, 2021

Thank you @lyrixx.

@fabpot fabpot merged commit 93e853d into symfony:5.x Jan 17, 2021
@lyrixx lyrixx deleted the role-hierarchy branch January 17, 2021 10:59
@fabpot fabpot mentioned this pull request Apr 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants