Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

InMemoryRoleProvider can reuse role objects #322

Closed
Wilt opened this issue Mar 15, 2016 · 3 comments
Closed

InMemoryRoleProvider can reuse role objects #322

Wilt opened this issue Mar 15, 2016 · 3 comments
Assignees

Comments

@Wilt
Copy link

Wilt commented Mar 15, 2016

In the current setup the child role in a HierarchicalRole is another Role instance with the same name. This is because of how the InMemoryRoleProvider is creating the roles. For example the $memberRole in the InMemoryRoleProviderTest is not the same object as the first child role of the $adminRole.

It would be cool to change the setup so that these tests are successful. I also think it will save some memory because in this case the roles are instantiated only once.

assertTrue($adminRole->getChildren()['member'] === $memberRole);
assertTrue($memberRole->getChildren()['guest'] === $guestRole);
@danizord
Copy link
Member

Looks good for me, can you provide a PR @Wilt?

@danizord danizord self-assigned this Mar 16, 2016
@danizord danizord added this to the 2.5.3 milestone Mar 16, 2016
@Wilt
Copy link
Author

Wilt commented Mar 16, 2016

Here a PR

@danizord danizord modified the milestones: 2.5.3, 2.5.7 Apr 25, 2016
@danizord
Copy link
Member

Fixed by #325

@danizord danizord removed this from the 2.5.7 milestone Jul 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants