ezsystems/ezpublish-kernel — pull request #899 by andrerom (2014-06-20 16:26:19+00:00)
Title: Fix EZP-22775: [API] Permissions should handle missing limitations better

Issue: https://jira.ez.no/browse/EZP-22775

Originally in #851 there was an attempt to solve the problem by catching the exceptions and assume that user does not have access under the current policy and continue iterate to the next one. However this does not benefit use of RoleService, where the exceptions are still the case and this can't be solved by silencing it.

### New approach
Creates:
- A BlockingLimitation[Type]
- A MatchNone Criterion
- Sub classed NotFoundException to LimitationNotFoundException to provide more information on how to solve in the exception message (we should do the same on field types)

The idea is that you can configure missing limitations to map to BLockingLimitation, which will by design make it clear you don't have access under the given policy, also when querying using MatchNone, as we can't possible know without actually implementing the Limitation.

### Benefit
Avoid exceptions on Limitations with no implementation that we don't really care about in New stack as they are not planned to be used. Example: ezjscore limitation.

### Open question
I have kept the catch clause in Repository->hasAccess() as added in #851, as it benefits pure usage of API, however on the other side it hides missing configuration so can be argued to be removed to make this behave 100% like missing FieldTypes where you need to configure NullType.