Resource returnValue = null;
final Iterator<ResourceAccessGateHandler> accessGateHandlers = getMatchingResourceAccessGateHandlerIterator(
resource.getPath(), ResourceAccessGate.Operation.READ);
GateResult finalGateResult = null;
List<ResourceAccessGate> accessGatesForReadValues = null;
boolean canReadAllValues = false;
if ( accessGateHandlers != null ) {
boolean noGateMatched = true;
while ( accessGateHandlers.hasNext() ) {
noGateMatched = false;
final ResourceAccessGateHandler resourceAccessGateHandler = accessGateHandlers.next();
final GateResult gateResult = !resourceAccessGateHandler
.getResourceAccessGate().hasReadRestrictions(resource.getResourceResolver()) ? GateResult.GRANTED
: resourceAccessGateHandler.getResourceAccessGate()
.canRead(resource);
if (!canReadAllValues && gateResult == GateResult.GRANTED) {
if (resourceAccessGateHandler.getResourceAccessGate().canReadAllValues(resource)) {