diff --git a/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java b/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
index f6e85af..f2742ce 100644
--- a/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
+++ b/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
@@ -81,10 +81,6 @@
     private ArrayList<String> foundries;
     private ArrayList<String> layers;
     
-//    private List<String> publicLicenses;
-//    private List<String> freeLicenses;
-//    private List<String> allLicenses;
-    
     private Pattern publicLicensePattern;
     private Pattern freeLicensePattern;
     private Pattern allLicensePattern;
@@ -167,14 +163,12 @@
         
         ldapConfig = properties.getProperty("ldap.config");
         
-//        freeLicenses = Arrays.asList(license.split("|"));
-//        publicLicenses = Arrays.asList(properties.getProperty("kustvakt.availability.public","").split("|"));
-//        allLicenses = Arrays.asList(properties.getProperty("kustvakt.availability.all","").split("|"));
+        // EM: replace this later with KoralQuery
+        freeLicensePattern = Pattern.compile(properties.getProperty("kustvakt.regex.free",""));
+        publicLicensePattern = Pattern.compile(properties.getProperty("kustvakt.regex.public",""));
+        allLicensePattern = Pattern.compile(properties.getProperty("kustvakt.regex.all",""));
         
-        freeLicensePattern = Pattern.compile(properties.getProperty("kustvakt.availability.free",""));
-        publicLicensePattern = Pattern.compile(properties.getProperty("kustvakt.availability.public",""));
-        allLicensePattern = Pattern.compile(properties.getProperty("kustvakt.availability.all",""));
-        
+        // EM: not use in the future
         policyConfig = properties.getProperty("policies.config");
         setFoundriesAndLayers(policyConfig);
         
diff --git a/src/main/java/de/ids_mannheim/korap/resource/rewrite/CollectionRewrite.java b/src/main/java/de/ids_mannheim/korap/resource/rewrite/CollectionRewrite.java
index 9d70e36..1de7d2f 100644
--- a/src/main/java/de/ids_mannheim/korap/resource/rewrite/CollectionRewrite.java
+++ b/src/main/java/de/ids_mannheim/korap/resource/rewrite/CollectionRewrite.java
@@ -1,22 +1,16 @@
 package de.ids_mannheim.korap.resource.rewrite;
 
-import java.util.ArrayList;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.fasterxml.jackson.databind.JsonNode;
-import com.google.common.collect.Lists;
 
 import de.ids_mannheim.korap.config.Attributes;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.query.object.KoralMatchOperator;
 import de.ids_mannheim.korap.resource.rewrite.KoralNode.RewriteIdentifier;
 import de.ids_mannheim.korap.user.User;
-import de.ids_mannheim.korap.user.User.CorpusAccess;
 import de.ids_mannheim.korap.utils.JsonUtils;
 import de.ids_mannheim.korap.utils.KoralCollectionQueryBuilder;
 
@@ -30,62 +24,12 @@
             .getLogger(CollectionRewrite.class);
     public static String AVAILABILITY = "availability";
 
-    public static Pattern notFreeLicense = Pattern.compile("ACA|QAO");
-    public static Pattern notPublicLicense = Pattern.compile("QAO");
-
 
     public CollectionRewrite () {
         super();
     }
 
 
-    private String verifyAvailability (JsonNode node, CorpusAccess access,
-            KustvaktConfiguration config) {
-
-        if (node.has("operands")) {
-            ArrayList<JsonNode> operands = Lists
-                    .newArrayList(node.at("/operands").elements());
-            for (int i = 0; i < operands.size(); i++) {
-                String path = verifyAvailability(operands.get(i), access,
-                        config);
-                if (!path.isEmpty()) { return "/operands/" + i; }
-            }
-        }
-        else if (node.has("key")
-                && node.at("/key").asText().equals(AVAILABILITY)) {
-            Matcher m;
-            String queryAvailability = node.at("/value").asText();
-            if (node.at("/match").asText()
-                    .equals(KoralMatchOperator.EQUALS.toString())) {
-
-                if (access.equals(CorpusAccess.FREE)) {
-                    m = notFreeLicense.matcher(queryAvailability);
-                    if (m.find()) return "/value";
-                }
-                else if (access.equals(CorpusAccess.PUB)) {
-                    m = notPublicLicense.matcher(queryAvailability);
-                    if (m.find()) return "/value";
-                }
-            }
-            // match:ne
-            else {
-                if (access.equals(CorpusAccess.FREE)) {
-                    m = config.getFreeLicensePattern()
-                            .matcher(queryAvailability);
-                    if (m.find()) return "/value";
-                }
-                else if (access.equals(CorpusAccess.PUB)) {
-                    m = config.getPublicLicensePattern()
-                            .matcher(queryAvailability);
-                    if (m.find()) return "/value";
-                }
-            }
-        }
-
-        return "";
-    }
-
-
     @Override
     public JsonNode rewriteQuery (KoralNode node, KustvaktConfiguration config,
             User user) throws KustvaktException {
@@ -110,24 +54,9 @@
         JsonNode rewrittesNode;
 
         if (jsonNode.has("collection")) {
-            String path = verifyAvailability(jsonNode.at("/collection"),
-                    user.getCorpusAccess(), config);
-            if (!path.isEmpty()) {
-                rewrittesNode = JsonUtils.readTree(builder.toJSON())
-                        .at("/collection");
-                if (path.equals("/value")) {
-                    node.replace("collection", rewrittesNode, identifier);
-                }
-                else {
-                    node.replaceAt("/collection" + path, rewrittesNode,
-                            identifier);
-                }
-            }
-            else {
-                builder.setBaseQuery(builder.toJSON());
-                rewrittesNode = builder.mergeWith(jsonNode).at("/collection");
-                node.set("collection", rewrittesNode, identifier);
-            }
+            builder.setBaseQuery(builder.toJSON());
+            rewrittesNode = builder.mergeWith(jsonNode).at("/collection");
+            node.set("collection", rewrittesNode, identifier);
         }
         else {
             rewrittesNode = JsonUtils.readTree(builder.toJSON())
@@ -135,7 +64,7 @@
             node.set("collection", rewrittesNode, identifier);
         }
 
-        jlog.debug("REWRITES: " + node.at("/collection").toString());
+        jlog.info("REWRITES: " + node.at("/collection").toString());
         return node.rawNode();
     }
 }
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 97aace6..03421e1 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
@@ -1171,63 +1171,7 @@
                     e.string());
             throw KustvaktResponseHandler.throwit(e);
         }
-        String results;
-//        // fixme: checks for policy matching
-//        // fixme: currently disabled, due to mishab in foundry/layer spec
-//        // fixme:
-//        if (foundries != null && foundries.size() > 1000) {
-//            Set<String> f_list = new HashSet<>();
-//            Set<String> l_list = new HashSet<>();
-//
-//            for (String spl : new ArrayList<>(foundries)) {
-//                try {
-//                    SecurityManager<?> manager = SecurityManager.init(spl, user,
-//                            Permissions.Permission.READ);
-//                    if (!manager.isAllowed())
-//                        continue;
-//
-//                    String[] sep = StringUtils.splitAnnotations(spl);
-//                    if (spl != null) {
-//                        f_list.add(sep[0]);
-//                        l_list.add(sep[1]);
-//                    };
-//                    results = searchKrill.getMatch(matchid,
-//                            new ArrayList<>(f_list), new ArrayList<>(l_list),
-//                            spans, false, true);
-//                }
-//                catch (NotAuthorizedException e) {
-//                    throw KustvaktResponseHandler.throwit(
-//                            StatusCodes.ACCESS_DENIED, "Permission denied",
-//                            matchid);
-//                }
-//
-//            }
-//            // all foundries shall be returned
-//        }
-//        else if (foundries != null && foundries.contains("*")) {
-//            Set<Layer> resources;
-//            try {
-//                resources = ResourceFinder.search(user, Layer.class);
-//            }
-//            catch (KustvaktException e) {
-//                jlog.error("Exception encountered: {}", e.string());
-//                throw KustvaktResponseHandler.throwit(e);
-//            }
-//            // returns foundries and layers.
-//            // todo: needs testing!
-//            foundries = new HashSet<>();
-//            layers = new HashSet<>();
-//            for (Layer r : resources) {
-//                String[] spl = StringUtils.splitAnnotations(r.getName());
-//                if (spl != null) {
-//                    foundries.add(spl[0]);
-//                    layers.add(spl[1]);
-//                }
-//            }
-//        }
         
-        
-        //EM: I dont need user here just corpusAccess
         CorpusAccess corpusAccess = user.getCorpusAccess();
         Pattern p;
         switch (corpusAccess) {
@@ -1241,6 +1185,8 @@
 			p = config.getFreeLicensePattern();
 			break;
 		}
+        
+        String results;
         try {
             if (!match_only){
             	
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/SearchServiceTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/SearchServiceTest.java
index 9bfe2f9..8786030 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/full/SearchServiceTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/SearchServiceTest.java
@@ -64,6 +64,8 @@
         assertEquals("CC-BY.*", node.at("/collection/value").asText());
         assertEquals("availability(FREE)",
                 node.at("/collection/rewrites/0/scope").asText());
+        assertEquals("operation:insertion",
+                node.at("/collection/rewrites/0/operation").asText());
     }
 
 
@@ -88,7 +90,51 @@
         assertEquals(-1, node.at("/meta/totalResults").asInt());
     }
 
-
+    @Test
+    public void testSearchQueryFreeExtern () {
+        ClientResponse response = resource().path(getAPIVersion())
+                .path("search").queryParam("q", "[orth=die]")
+                .queryParam("ql", "poliqarp")
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .get(ClientResponse.class);
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+        String entity = response.getEntity(String.class);
+        JsonNode node = JsonUtils.readTree(entity);
+        assertNotNull(node);
+        assertNotEquals(0, node.path("matches").size());
+        assertEquals("koral:doc", node.at("/collection/@type").asText());
+        assertEquals("availability", node.at("/collection/key").asText());
+        assertEquals("CC-BY.*", node.at("/collection/value").asText());
+        assertEquals("availability(FREE)",
+                node.at("/collection/rewrites/0/scope").asText());
+        assertEquals("operation:insertion",
+                node.at("/collection/rewrites/0/operation").asText());
+    }
+    
+    @Test
+    public void testSearchQueryFreeIntern () {
+        ClientResponse response = resource().path(getAPIVersion())
+                .path("search").queryParam("q", "[orth=die]")
+                .queryParam("ql", "poliqarp")
+                .header(HttpHeaders.X_FORWARDED_FOR, "172.27.0.32")
+                .get(ClientResponse.class);
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+        String entity = response.getEntity(String.class);
+        JsonNode node = JsonUtils.readTree(entity);
+        assertNotNull(node);
+        assertNotEquals(0, node.path("matches").size());
+        assertEquals("koral:doc", node.at("/collection/@type").asText());
+        assertEquals("availability", node.at("/collection/key").asText());
+        assertEquals("CC-BY.*", node.at("/collection/value").asText());
+        assertEquals("availability(FREE)",
+                node.at("/collection/rewrites/0/scope").asText());
+        assertEquals("operation:insertion",
+                node.at("/collection/rewrites/0/operation").asText());
+    }
+    
+    
     @Test
     public void testSearchQueryExternAuthorized () {
         ClientResponse response = resource().path(getAPIVersion())
@@ -111,9 +157,10 @@
         assertEquals("operation:or", node.at("/collection/operation").asText());
         assertEquals("availability(PUB)",
                 node.at("/collection/rewrites/0/scope").asText());
+        assertEquals("operation:insertion",
+                node.at("/collection/rewrites/0/operation").asText());
     }
 
-
     @Test
     public void testSearchQueryInternAuthorized () {
         ClientResponse response = resource().path(getAPIVersion())
@@ -129,20 +176,23 @@
         JsonNode node = JsonUtils.readTree(entity);
         assertNotNull(node);
         assertNotEquals(0, node.path("matches").size());
-        assertEquals("koral:docGroup", node.at("/collection/@type").asText());
-        assertEquals("QAO.*", node.at("/collection/operands/0/value").asText());
-        assertEquals("ACA.*",
-                node.at("/collection/operands/1/operands/0/value").asText());
-        assertEquals("CC-BY.*",
-                node.at("/collection/operands/1/operands/1/value").asText());
-        assertEquals("operation:or", node.at("/collection/operation").asText());
-        assertEquals("availability(ALL)",
-                node.at("/collection/rewrites/0/scope").asText());
+        //EM: no rewrite is needed
+//        assertEquals("koral:docGroup", node.at("/collection/@type").asText());
+//        assertEquals("QAO.*", node.at("/collection/operands/0/value").asText());
+//        assertEquals("ACA.*",
+//                node.at("/collection/operands/1/operands/0/value").asText());
+//        assertEquals("CC-BY.*",
+//                node.at("/collection/operands/1/operands/1/value").asText());
+//        assertEquals("operation:or", node.at("/collection/operation").asText());
+//        assertEquals("availability(ALL)",
+//                node.at("/collection/rewrites/0/scope").asText());
+//        assertEquals("operation:insertion",
+//                node.at("/collection/rewrites/0/operation").asText());
     }
 
-
+ // EM: shouldn't this case gets CorpusAccess.PUB ? 
     @Test
-    public void testSearchQueryWithCollectionQueryAuthorizedNoIP () {
+    public void testSearchQueryWithCollectionQueryAuthorizedWithoutIP () {
         ClientResponse response = resource().path(getAPIVersion())
                 .path("search").queryParam("q", "[orth=das]")
                 .queryParam("ql", "poliqarp")
@@ -160,110 +210,40 @@
         assertEquals("availability(PUB)",
                 node.at("/collection/rewrites/0/scope").asText());
         // EM: double AND operations
-        assertEquals("availability", node.at("/collection/operands/0/key").asText());
-        assertEquals("CC-BY.*", node.at("/collection/operands/0/value").asText());
+        assertEquals("availability",
+                node.at("/collection/operands/0/key").asText());
+        assertEquals("CC-BY.*",
+                node.at("/collection/operands/0/value").asText());
         assertEquals("textClass",
                 node.at("/collection/operands/1/operands/0/key").asText());
         assertEquals("corpusSigle",
                 node.at("/collection/operands/1/operands/1/key").asText());
     }
-
-
-    @Test
-    public void testSearchQueryWithCollectionQueryUnauthorized () {
-        ClientResponse response = resource().path(getAPIVersion())
-                .path("search").queryParam("q", "[orth=das]")
-                .queryParam("ql", "poliqarp")
-                .queryParam("cq", "availability != /CC-BY.*/")
-                .get(ClientResponse.class);
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-                response.getStatus());
-
-        JsonNode node = JsonUtils.readTree(response.getEntity(String.class));
-        assertNotNull(node);
-        assertEquals("availability", node.at("/collection/key").asText());
-        assertEquals("CC-BY.*", node.at("/collection/value").asText());
-        assertEquals("operation:override",
-                node.at("/collection/rewrites/0/operation").asText());
-        assertEquals("availability(FREE)",
-                node.at("/collection/rewrites/0/scope").asText());
-        assertEquals("koral:token", node.at("/query/@type").asText());
-    }
     
     @Test
-    public void testSearchQueryWithComplexCollectionQueryUnauthorized () {
+    public void testSearchQueryAuthorizedWithoutIP () {
         ClientResponse response = resource().path(getAPIVersion())
-                .path("search").queryParam("q", "[orth=das]")
+                .path("search").queryParam("q", "[orth=die]")
                 .queryParam("ql", "poliqarp")
-                .queryParam("cq", "textClass=politik & availability != /CC-BY.*/")
-                .get(ClientResponse.class);
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-                response.getStatus());
-
-        JsonNode node = JsonUtils.readTree(response.getEntity(String.class));
-        assertNotNull(node);
-        assertEquals("textClass", node.at("/collection/operands/0/key").asText());
-        assertEquals("politik", node.at("/collection/operands/0/value").asText());
-        assertEquals("match:eq", node.at("/collection/operands/1/match").asText());
-        assertEquals("availability", node.at("/collection/operands/1/key").asText());
-        assertEquals("CC-BY.*", node.at("/collection/operands/1/value").asText());
-        assertEquals("operation:override",
-                node.at("/collection/rewrites/0/operation").asText());
-        assertEquals("availability(FREE)",
-                node.at("/collection/rewrites/0/scope").asText());
-    }
-    
-    @Test
-    public void testSearchQueryWithComplexCollectionQueryUnauthorized2 () {
-        ClientResponse response = resource().path(getAPIVersion())
-                .path("search").queryParam("q", "[orth=das]")
-                .queryParam("ql", "poliqarp")
-                .queryParam("cq", "textClass=politik & availability=ACA-NC")
-                .get(ClientResponse.class);
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-                response.getStatus());
-
-        JsonNode node = JsonUtils.readTree(response.getEntity(String.class));
-        assertNotNull(node);
-        assertEquals("textClass", node.at("/collection/operands/0/key").asText());
-        assertEquals("politik", node.at("/collection/operands/0/value").asText());
-        assertEquals("match:eq", node.at("/collection/operands/1/match").asText());
-        assertEquals("availability", node.at("/collection/operands/1/key").asText());
-        assertEquals("CC-BY.*", node.at("/collection/operands/1/value").asText());
-        assertEquals("operation:override",
-                node.at("/collection/rewrites/0/operation").asText());
-        assertEquals("availability(FREE)",
-                node.at("/collection/rewrites/0/scope").asText());
-    }
-
-    @Test
-    public void testSearchQueryWithComplexCollectionQueryPublicOverride () {
-        ClientResponse response = resource().path(getAPIVersion())
-                .path("search").queryParam("q", "[orth=das]")
-                .queryParam("ql", "poliqarp")
-                .queryParam("cq", "textClass=politik & availability=QAO-NC-LOC:ids")
                 .header(Attributes.AUTHORIZATION,
                         BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
-                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
                 .get(ClientResponse.class);
         assertEquals(ClientResponse.Status.OK.getStatusCode(),
                 response.getStatus());
-
-        JsonNode node = JsonUtils.readTree(response.getEntity(String.class));
+        String entity = response.getEntity(String.class);
+        JsonNode node = JsonUtils.readTree(entity);
         assertNotNull(node);
-        assertEquals("textClass", node.at("/collection/operands/0/key").asText());
-        assertEquals("politik", node.at("/collection/operands/0/value").asText());
-        assertEquals("match:eq", node.at("/collection/operands/1/operands/0/match").asText());
-        assertEquals("availability", node.at("/collection/operands/1/operands/0/key").asText());
-        assertEquals("CC-BY.*", node.at("/collection/operands/1/operands/0/value").asText());
-        assertEquals("match:eq", node.at("/collection/operands/1/operands/1/match").asText());
-        assertEquals("ACA.*", node.at("/collection/operands/1/operands/1/value").asText());
-        assertEquals("operation:override",
-                node.at("/collection/rewrites/0/operation").asText());
+        assertNotEquals(0, node.path("matches").size());
+        assertEquals("koral:docGroup", node.at("/collection/@type").asText());
+        assertEquals("CC-BY.*",
+                node.at("/collection/operands/0/value").asText());
+        assertEquals("ACA.*", node.at("/collection/operands/1/value").asText());
+        assertEquals("operation:or", node.at("/collection/operation").asText());
         assertEquals("availability(PUB)",
                 node.at("/collection/rewrites/0/scope").asText());
     }
-
+    
+    
 
     @Test
     @Ignore
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/SearchWithAvailabilityTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/SearchWithAvailabilityTest.java
new file mode 100644
index 0000000..b2f46b0
--- /dev/null
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/SearchWithAvailabilityTest.java
@@ -0,0 +1,333 @@
+package de.ids_mannheim.korap.web.service.full;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.eclipse.jetty.http.HttpHeaders;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.sun.jersey.api.client.ClientResponse;
+
+import de.ids_mannheim.korap.config.Attributes;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.security.auth.BasicHttpAuth;
+import de.ids_mannheim.korap.utils.JsonUtils;
+import de.ids_mannheim.korap.web.service.FastJerseyTest;
+
+public class SearchWithAvailabilityTest extends FastJerseyTest {
+
+    @Override
+    public void initMethod () throws KustvaktException {
+        helper().runBootInterfaces();
+    }
+
+
+    @BeforeClass
+    public static void configure () throws Exception {
+        FastJerseyTest.setPackages("de.ids_mannheim.korap.web.service.full",
+                "de.ids_mannheim.korap.web.filter",
+                "de.ids_mannheim.korap.web.utils");
+    }
+
+    private void checkAndFree (String json) {
+        JsonNode node = JsonUtils.readTree(json);
+        assertEquals("availability",
+                node.at("/collection/operands/0/key").asText());
+        assertEquals("CC-BY.*",
+                node.at("/collection/operands/0/value").asText());
+        assertEquals("operation:insertion",
+                node.at("/collection/rewrites/0/operation").asText());
+        assertEquals("availability(FREE)",
+                node.at("/collection/rewrites/0/scope").asText());
+    }
+
+
+    private void checkAndPublic (String json) {
+        JsonNode node = JsonUtils.readTree(json);
+        assertNotNull(node);
+        assertEquals("operation:and",
+                node.at("/collection/operation").asText());
+        assertEquals("match:eq",
+                node.at("/collection/operands/0/operands/0/match").asText());
+        assertEquals("type:regex",
+                node.at("/collection/operands/0/operands/0/type").asText());
+        assertEquals("availability",
+                node.at("/collection/operands/0/operands/0/key").asText());
+        assertEquals("CC-BY.*",
+                node.at("/collection/operands/0/operands/0/value").asText());
+        assertEquals("match:eq",
+                node.at("/collection/operands/0/operands/1/match").asText());
+        assertEquals("ACA.*",
+                node.at("/collection/operands/0/operands/1/value").asText());
+        assertEquals("operation:insertion",
+                node.at("/collection/rewrites/0/operation").asText());
+        assertEquals("availability(PUB)",
+                node.at("/collection/rewrites/0/scope").asText());
+    }
+    
+    private void checkAndAll (String json) {
+        JsonNode node = JsonUtils.readTree(json);
+        assertNotNull(node);
+        assertEquals("availability(ALL)",
+                node.at("/collection/rewrites/0/scope").asText());
+        assertEquals("operation:insertion",
+                node.at("/collection/rewrites/0/operation").asText());
+        
+        assertEquals("operation:and",
+                node.at("/collection/operation").asText());
+        
+        node = node.at("/collection/operands/0");
+        assertEquals("operation:or",
+                node.at("/operation").asText());
+        
+        assertEquals("match:eq",
+                node.at("/operands/0/match").asText());
+        assertEquals("match:eq",
+                node.at("/operands/0/match").asText());
+        assertEquals("type:regex",
+                node.at("/operands/0/type").asText());
+        assertEquals("availability",
+                node.at("/operands/0/key").asText());
+        assertEquals("QAO.*",
+                node.at("/operands/0/value").asText());
+        
+        node = node.at("/operands/1");
+        assertEquals("operation:or",
+                node.at("/operation").asText());
+        assertEquals("match:eq",
+                node.at("/operands/0/match").asText());
+        assertEquals("ACA.*",
+                node.at("/operands/0/value").asText());
+        assertEquals("match:eq",
+                node.at("/operands/1/match").asText());
+        assertEquals("CC-BY.*",
+                node.at("/operands/1/value").asText());
+        
+    }
+
+
+    private ClientResponse builtSimpleClientResponse (String collectionQuery) {
+        return resource().path(getAPIVersion()).path("search")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .queryParam("cq", collectionQuery).get(ClientResponse.class);
+    }
+
+
+    private ClientResponse builtClientResponseWithIP (String collectionQuery,
+            String ip) {
+        return resource().path(getAPIVersion()).path("search")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .queryParam("cq", collectionQuery)
+                .header(Attributes.AUTHORIZATION,
+                        BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
+                .header(HttpHeaders.X_FORWARDED_FOR, ip)
+                .get(ClientResponse.class);
+    }
+
+
+    @Test
+    public void testAvailabilityFreeAuthorized () {
+        ClientResponse response = builtSimpleClientResponse(
+                "availability = CC-BY-SA");
+
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+
+        checkAndFree(response.getEntity(String.class));
+    }
+
+
+    @Test
+    public void testAvailabilityRegexFreeAuthorized () {
+        ClientResponse response = builtSimpleClientResponse(
+                "availability = /.*BY.*/");
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+
+        checkAndFree(response.getEntity(String.class));
+    }
+
+
+    @Test
+    public void testAvailabilityFreeUnauthorized () {
+        ClientResponse response = builtSimpleClientResponse(
+                "availability = ACA-NC");
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+
+        checkAndFree(response.getEntity(String.class));
+    }
+
+
+    @Test
+    public void testAvailabilityRegexFreeUnauthorized () {
+        ClientResponse response = builtSimpleClientResponse(
+                "availability = /ACA.*/");
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+
+        checkAndFree(response.getEntity(String.class));
+    }
+
+
+    @Test
+    public void testAvailabilityRegexFreeUnauthorized2 () {
+        ClientResponse response = builtSimpleClientResponse(
+                "availability = /.*NC.*/");
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+
+        checkAndFree(response.getEntity(String.class));
+    }
+
+
+
+    @Test
+    public void testNegationAvailabilityFreeUnauthorized () {
+        ClientResponse response = builtSimpleClientResponse(
+                "availability != /CC-BY.*/");
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+
+        checkAndFree(response.getEntity(String.class));
+    }
+
+
+    @Test
+    public void testNegationAvailabilityFreeUnauthorized2 () {
+        ClientResponse response = builtSimpleClientResponse(
+                "availability != /.*BY.*/");
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+
+        checkAndFree(response.getEntity(String.class));
+    }
+
+
+    @Test
+    public void testComplexNegationAvailabilityFreeUnauthorized () {
+        ClientResponse response = builtSimpleClientResponse(
+                "textClass=politik & availability != /CC-BY.*/");
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+
+        checkAndFree(response.getEntity(String.class));
+    }
+
+
+    @Test
+    public void testComplexAvailabilityFreeUnauthorized () {
+        ClientResponse response = builtSimpleClientResponse(
+                "textClass=politik & availability=ACA-NC");
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+
+        checkAndFree(response.getEntity(String.class));
+    }
+
+
+    @Test
+    public void testComplexAvailabilityFreeUnauthorized3 () {
+        ClientResponse response = builtSimpleClientResponse(
+                "textClass=politik & availability=/.*NC.*/");
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+
+        checkAndFree(response.getEntity(String.class));
+    }
+
+
+    @Test
+    public void testAvailabilityPublicAuthorized () {
+        ClientResponse response = builtClientResponseWithIP(
+                "availability=ACA-NC", "149.27.0.32");
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+        
+        checkAndPublic(response.getEntity(String.class));
+    }
+
+
+    @Test
+    public void testAvailabilityPublicUnauthorized () {
+        ClientResponse response = builtClientResponseWithIP(
+                "availability=QAO-NC-LOC:ids", "149.27.0.32");
+
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+
+        checkAndPublic(response.getEntity(String.class));
+    }
+
+
+    @Test
+    public void testAvailabilityRegexPublicAuthorized () {
+        ClientResponse response = builtClientResponseWithIP(
+                "availability= /ACA.*/", "149.27.0.32");
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+
+        checkAndPublic(response.getEntity(String.class));
+    }
+
+
+    @Test
+    public void testNegationAvailabilityPublicUnauthorized () {
+        ClientResponse response = builtClientResponseWithIP(
+                "availability != ACA-NC", "149.27.0.32");
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+
+        checkAndPublic(response.getEntity(String.class));
+    }
+
+
+    @Test
+    public void testNegationAvailabilityRegexPublicUnauthorized () {
+        ClientResponse response = builtClientResponseWithIP(
+                "availability != /ACA.*/", "149.27.0.32");
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+
+        checkAndPublic(response.getEntity(String.class));
+    }
+
+
+    @Test
+    public void testComplexAvailabilityPublicUnauthorized () {
+        ClientResponse response = builtClientResponseWithIP(
+                "textClass=politik & availability=QAO-NC-LOC:ids",
+                "149.27.0.32");
+
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+
+        checkAndPublic(response.getEntity(String.class));
+    }
+
+
+    @Test
+    public void testNegationComplexAvailabilityPublicUnauthorized () {
+        ClientResponse response = builtClientResponseWithIP(
+                "textClass=politik & availability!=QAO-NC-LOC:ids",
+                "149.27.0.32");
+
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+
+        checkAndPublic(response.getEntity(String.class));
+    }
+
+    @Test
+    public void testAvailabilityRegexAllAuthorized () {
+        ClientResponse response = builtClientResponseWithIP(
+                "availability= /ACA.*/", "10.27.0.32");
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+
+        checkAndAll(response.getEntity(String.class));
+    }
+    
+}
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/UserServiceTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/UserServiceTest.java
index 5502366..a3641b1 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/full/UserServiceTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/UserServiceTest.java
@@ -155,7 +155,7 @@
 
 	// EM: This test require VPN / IDS Intranet
 	@Test
-	@Ignore
+//	@Ignore
 	public void loginJWT() {
 		String en = BasicHttpAuth.encode(credentials[0], credentials[1]);
 		/* lauffähige Version von Hanl: */
