symfony/symfony — pull request #8313 by cabello (2013-06-19 19:28:29+00:00)
Title: RoleSecurityIdentity checks for instances of RoleInterface to allow custom Role implementation

Hi,

We are using a **custom** `Role` entity that's implementing the `RoleInterface`, but when we tried to apply ACL on the application, some `SecurityContext->isGranted` calls were denying access when they should actually allow.

After checking database, our code, Symfony code, we got to the dead end where the following triple comparison was returning false:

$this->role === $sid->getRole()

One `$this->role` was holding our custom object that implements the RoleInterface the other `$sid->getRole()` was holding a string, the strict comparison would obviously fail.

After updating the constructor and tests, everything looks great.

Thanks,