Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Component] [Security] [Acl] [Domain] Role security identity fix#7791
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Casting the role property in the constructor is necessary tolet the equals function binary comparison work properly whileusing a custom role entity.The security identity retrieval strategy getSecurityIdentitiesfunction instantiates the role security identity class passing anobject. The constructor will assign this object to $this->role in case it's not an instance of Role. Binary safe comparison will fail even though gettype returns "string". The custom role entity requires a __toString magic method in this case.
The role security identity was only working when using the origin Role class. The construct method is changed to enable support for custom role entities.
guilhermeblanco commentedDec 3, 2013
This is exactly the same as#8313 |
guilhermeblanco commentedDec 3, 2013
@henneboele can you please close your PR in favor of#8313 ? Also, don't forget to do a +1 there. =) |
stloyd commentedDec 3, 2013
@guilhermeblanco I remember the first one about this =) Yet almost2,5 year after that one westill don't have real anwser why this can't be merged... =) |
Casting the role property in the constructor is necessary to let the equals function binary comparison work properly while using a custom role entity.
The security identity retrieval strategy getSecurityIdentities function instantiates the role security identity class passing an object. The constructor will assign this object to $this->role in case it's not an instance of Role. Binary safe comparison will fail even though gettype returns "string". The custom role entity requires a __toString magic method in this case.