zendframework/zf2 — pull request #4210 by tux-rampage (2013-04-11 13:28:58+00:00)
Title: Fixed failure when implementing custom rbac roles

`Zend\Permissions\Rbac\Rbac::isGranted()` will faill, when implementing the interface `Zend\Permissions\Rbac\RoleInterface` with a custom role and adding it to a `Zend\Permissions\Rbac\Rbac` instance with parents (due to missing implementation of RecursiveIterator on the custom role).

```php
$custom = new MyCustomRole();
$rbac->addRole($custom, 'foo');
$rbac->isGranted('foo', 'something'); // <- failure
```

This example will throw an UnexpectedValueException ("Objects returned by RecursiveIterator::getChildren() must implement RecursiveIterator").

* Added a unit test to reflect this behavior
* Implemented a fix by improving the hasChildren() implementation in
`Zend\Permissions\Rbac\AbstractIterator`