Added corpus check for demo user.

Change-Id: I2a21b8373d80ca251a1b8322fb45e625a8b4d503
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java b/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java
index db2ae48..39ef339 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java
@@ -1146,14 +1146,14 @@
                     e.string());
             throw KustvaktResponseHandler.throwit(e);
         }
-        
-        try {
-            ResourceFinder.searchPublicFiltered(Corpus.class, corpusId);
+        if (user instanceof DemoUser){
+	        try {
+	            ResourceFinder.searchPublicFiltered(Corpus.class, corpusId);
+	        }
+	        catch (KustvaktException e) {
+	            throw KustvaktResponseHandler.throwit(e);
+	        }
         }
-        catch (KustvaktException e) {
-            throw KustvaktResponseHandler.throwit(e);
-        }
-
         String results;
         // fixme: checks for policy matching
         // fixme: currently disabled, due to mishab in foundry/layer spec
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/MatchInfoServiceTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/MatchInfoServiceTest.java
index c3f3724..8ff5794 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/full/MatchInfoServiceTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/MatchInfoServiceTest.java
@@ -65,10 +65,11 @@
                         BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
                 .get(ClientResponse.class);
 
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-                response.getStatus());
         String entity = response.getEntity(String.class);
 //        System.out.println(entity);
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+        
         JsonNode node = JsonUtils.readTree(entity);
         assertNotNull(node);
         assertEquals("WPD15/B07/51608", node.at("/textSigle").asText());