Skip to content
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

Wrong check role instance in RoleSecurityIdentity class #18

Open
Redigast13 opened this issue Jan 17, 2016 · 1 comment
Open

Wrong check role instance in RoleSecurityIdentity class #18

Redigast13 opened this issue Jan 17, 2016 · 1 comment

Comments

@Redigast13
Copy link

There is a check in constructor of Symfony\Component\Security\Acl\Domain:
if ($role instanceof Role) {
$role = $role->getRole();
}
I think it is better to check on Symfony\Component\Security\Core\Role\RoleInterface instead of Symfony\Component\Security\Core\Role\Role class
Pull request: #17

@Redigast13 Redigast13 changed the title Wrong check role instance in RoleSecurityIdentity Wrong check role instance in RoleSecurityIdentity class Jan 17, 2016
@raphahardt
Copy link

+1

There is a issue with Symfony\Component\Security\Acl\Domain\PermissionGrantingStrategy, on line 144. When you have a Role entity that implements RoleInterface instead of extending Role, the equals method fails, because on the left side, the $sid has a string in the role property, and on the right side, the $ace->getSecurityIdentity() has a RoleInterface object (your entity, instead of expected string). So, the ACL always deny the user that has that role, even if it has granted.

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

No branches or pull requests

2 participants