public function userHasRole($roleName, DeterminableUserInterface $user)
    {
        $userHasRole = false;
        if (true === in_array($roleName, $user->getRoles())) {
            $userHasRole = true;
        }
        return $userHasRole;
    }
public function userHasRole($roleName, DeterminableUserInterface $user)
    {
        $userHasRole = false;
        if (true === in_array($roleName, $user->getRoles())) {
            $userHasRole = true;
        }
        return $userHasRole;
    }
public function userHasRole ( $ roleName , DeterminableUserInterface $ user ) { $ userHasRole = false ; if ( true === in_array ( $ roleName , $ user -> getRoles ( ) ) ) { $ userHasRole = true ; } return $ userHasRole ; }
Checks if a user has the given role
@param string $roleName
@param DeterminableUserInterface $user
@return bool
Checks if a user has the given role