@Test public void filterResultsWithOneColumnNotEntityReference() { List<Object> results = Collections.singletonList("Path.To.Page"); assertEquals(Collections.emptyList(), this.filter.filterResults(results)); }
@Override public List filterResults(List results) { List<Object> filteredResults = new LinkedList<>(); for (Object result : results) { EntityReference entityReference = null; if (result instanceof EntityReference) { entityReference = (EntityReference) result; } else if (result instanceof Object[] && ((Object[]) result)[0] instanceof EntityReference) { entityReference = (EntityReference) ((Object[]) result)[0]; } if (entityReference != null && this.authorization.hasAccess(Right.VIEW, entityReference)) { filteredResults.add(result); } } return filteredResults; }
ViewableQueryFilter implements QueryFilter { @Override public List filterResults(List results) { List<Object> filteredResults = new LinkedList<>(); for (Object result : results) { EntityReference entityReference = null; if (result instanceof EntityReference) { entityReference = (EntityReference) result; } else if (result instanceof Object[] && ((Object[]) result)[0] instanceof EntityReference) { entityReference = (EntityReference) ((Object[]) result)[0]; } if (entityReference != null && this.authorization.hasAccess(Right.VIEW, entityReference)) { filteredResults.add(result); } } return filteredResults; } }
ViewableQueryFilter implements QueryFilter { @Override public List filterResults(List results) { List<Object> filteredResults = new LinkedList<>(); for (Object result : results) { EntityReference entityReference = null; if (result instanceof EntityReference) { entityReference = (EntityReference) result; } else if (result instanceof Object[] && ((Object[]) result)[0] instanceof EntityReference) { entityReference = (EntityReference) ((Object[]) result)[0]; } if (entityReference != null && this.authorization.hasAccess(Right.VIEW, entityReference)) { filteredResults.add(result); } } return filteredResults; }  }
ViewableQueryFilter implements QueryFilter { @Override public List filterResults(List results) { List<Object> filteredResults = new LinkedList<>(); for (Object result : results) { EntityReference entityReference = null; if (result instanceof EntityReference) { entityReference = (EntityReference) result; } else if (result instanceof Object[] && ((Object[]) result)[0] instanceof EntityReference) { entityReference = (EntityReference) ((Object[]) result)[0]; } if (entityReference != null && this.authorization.hasAccess(Right.VIEW, entityReference)) { filteredResults.add(result); } } return filteredResults; }  @Override String filterStatement(String statement, String language); @Override List filterResults(List results); }
ViewableQueryFilter implements QueryFilter { @Override public List filterResults(List results) { List<Object> filteredResults = new LinkedList<>(); for (Object result : results) { EntityReference entityReference = null; if (result instanceof EntityReference) { entityReference = (EntityReference) result; } else if (result instanceof Object[] && ((Object[]) result)[0] instanceof EntityReference) { entityReference = (EntityReference) ((Object[]) result)[0]; } if (entityReference != null && this.authorization.hasAccess(Right.VIEW, entityReference)) { filteredResults.add(result); } } return filteredResults; }  @Override String filterStatement(String statement, String language); @Override List filterResults(List results);  }