ZF-Commons/zfc-rbac — pull request #135 by manuakasam (2013-12-21 04:20:39+00:00)
Title: Allowing assertions to work :)

The UnitTests for Assertions clearly need some love, but i won't get to that anymore today :( Assertions never worked to begin with as you've always just returned the false case scenario, the assertion check never returned true.

Alternatively to the above `(bool) $assertion` schema we could do a more explicit return, too, which may be a bit better as far as verbosity and less magic goes, like this:

```php
if (is_callable($assertion)) {
if (true === $assertion($identity)) {
return true;
}
return false;
} elseif ($assertion instanceof AssertionInterface) {
if (true === $assertion->assert($identity)) {
return true;
}
return false;
}
```

This way the AuthService would only return true for assertions if the assertion really returns the boolean value `true`. The PR would allow for non boolean values to be returned and be converted using the boolean operator `(bool)`. Personally I would be totally fine with that but this is up for you to decide ;)