}
}
} catch (NoSuchMethodException e) {
//
} catch (Exception e) {
throw new JWIGException(e);
}
if (!accessMethodResult) {
return false;
}
//If the access method returns true, make sure the constraints from the @AccessScope annotations are also satisfied
boolean accessScopeAnnotationResult = true;
boolean hasAccessScopeAnnotation = false;
for (Method m : querier.getClass(persistable).getMethods()) {
if (m.getAnnotation(AccessScope.class) != null) {
if (m.getParameterTypes().length == 0 && Persistable.class.isAssignableFrom(m.getReturnType())) {
m.setAccessible(true);
hasAccessScopeAnnotation = true;
try {
accessScopeAnnotationResult &= hasAccess((Persistable) m.invoke(persistable), depth + 1);
} catch (Exception e) {
throw new JWIGException(e);
}
}
}
}
if (!hasAccessScopeAnnotation && !hasAccessMethod) return false;