symfony/symfony — pull request #10970 by MarcomTeam (2014-05-22 19:16:46+00:00)
Title: [Component][Security][Role] magic method to make comparisons easier

Now
```
in_array('ROLE_ADMIN', $user->getRoles())
```
will work.

I know this can be done with $user->hasRole() method, but consider following:
```
!!array_intersect(array('ROLE_1', 'ROLE_2'), $user->getRoles())
```
to check if user has at least one of roles.