diff --git a/src/main/java/de/ids_mannheim/korap/dto/QueryAccessDto.java b/src/main/java/de/ids_mannheim/korap/dto/RoleDto.java
similarity index 71%
rename from src/main/java/de/ids_mannheim/korap/dto/QueryAccessDto.java
rename to src/main/java/de/ids_mannheim/korap/dto/RoleDto.java
index f6e1173..0e16496 100644
--- a/src/main/java/de/ids_mannheim/korap/dto/QueryAccessDto.java
+++ b/src/main/java/de/ids_mannheim/korap/dto/RoleDto.java
@@ -2,12 +2,13 @@
 
 import java.util.List;
 
-import de.ids_mannheim.korap.entity.UserGroupMember;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
 import lombok.Getter;
 import lombok.Setter;
 
 /**
- * Defines the structure of query accesses, e.g. as JSON
+ * Defines the structure of query roles, e.g. as JSON
  * objects in HTTP Responses.
  * 
  * @author margaretha
@@ -15,9 +16,12 @@
  */
 @Getter
 @Setter
-public class QueryAccessDto {
+public class RoleDto {
     private int roleId;
+    private String privilege;
+    @JsonInclude(JsonInclude.Include.NON_DEFAULT)
     private int queryId;
+    @JsonInclude(JsonInclude.Include.NON_NULL)
     private String queryName;
     private int userGroupId;
     private String userGroupName;
diff --git a/src/main/java/de/ids_mannheim/korap/dto/converter/QueryAccessConverter.java b/src/main/java/de/ids_mannheim/korap/dto/converter/RoleConverter.java
similarity index 68%
rename from src/main/java/de/ids_mannheim/korap/dto/converter/QueryAccessConverter.java
rename to src/main/java/de/ids_mannheim/korap/dto/converter/RoleConverter.java
index e2445e4..08ddb8e 100644
--- a/src/main/java/de/ids_mannheim/korap/dto/converter/QueryAccessConverter.java
+++ b/src/main/java/de/ids_mannheim/korap/dto/converter/RoleConverter.java
@@ -6,7 +6,7 @@
 
 import org.springframework.stereotype.Component;
 
-import de.ids_mannheim.korap.dto.QueryAccessDto;
+import de.ids_mannheim.korap.dto.RoleDto;
 import de.ids_mannheim.korap.entity.Role;
 import de.ids_mannheim.korap.entity.UserGroupMember;
 
@@ -20,16 +20,19 @@
  *
  */
 @Component
-public class QueryAccessConverter {
+public class RoleConverter {
 
-    public List<QueryAccessDto> createRoleDto (Set<Role> roles) {
-        List<QueryAccessDto> dtos = new ArrayList<>(roles.size());
+    public List<RoleDto> createRoleDto (Set<Role> roles) {
+        List<RoleDto> dtos = new ArrayList<>(roles.size());
         for (Role role : roles) {
-            QueryAccessDto dto = new QueryAccessDto();
+            RoleDto dto = new RoleDto();
             dto.setRoleId(role.getId());
-//            dto.setCreatedBy(role.getCreatedBy());
-            dto.setQueryId(role.getQuery().getId());
-            dto.setQueryName(role.getQuery().getName());
+            dto.setPrivilege(role.getPrivilege().name());
+            
+            if (role.getQuery() != null) {
+                dto.setQueryId(role.getQuery().getId());
+                dto.setQueryName(role.getQuery().getName());
+            }
             dto.setUserGroupId(role.getUserGroup().getId());
             dto.setUserGroupName(role.getUserGroup().getName());
             List<String> members = new ArrayList<>(
diff --git a/src/main/java/de/ids_mannheim/korap/service/QueryService.java b/src/main/java/de/ids_mannheim/korap/service/QueryService.java
index cf3f70e..b9d7c3c 100644
--- a/src/main/java/de/ids_mannheim/korap/service/QueryService.java
+++ b/src/main/java/de/ids_mannheim/korap/service/QueryService.java
@@ -29,9 +29,9 @@
 import de.ids_mannheim.korap.dao.RoleDao;
 import de.ids_mannheim.korap.dao.UserGroupDao;
 import de.ids_mannheim.korap.dao.UserGroupMemberDao;
-import de.ids_mannheim.korap.dto.QueryAccessDto;
+import de.ids_mannheim.korap.dto.RoleDto;
 import de.ids_mannheim.korap.dto.QueryDto;
-import de.ids_mannheim.korap.dto.converter.QueryAccessConverter;
+import de.ids_mannheim.korap.dto.converter.RoleConverter;
 import de.ids_mannheim.korap.dto.converter.QueryConverter;
 import de.ids_mannheim.korap.entity.QueryDO;
 import de.ids_mannheim.korap.entity.Role;
@@ -97,7 +97,7 @@
     @Autowired
     private QueryConverter converter;
     @Autowired
-    private QueryAccessConverter accessConverter;
+    private RoleConverter accessConverter;
 
     private void verifyUsername (String contextUsername, String pathUsername)
             throws KustvaktException {
@@ -577,16 +577,15 @@
 //        return accessConverter.createQueryAccessDto(accessList);
 //    }
 
-    public List<QueryAccessDto> listRolesByGroup (String username,
-            String groupName) throws KustvaktException {
+    public List<RoleDto> listRolesByGroup (String username,
+            String groupName, boolean hasQuery) throws KustvaktException {
         UserGroup userGroup = userGroupService
                 .retrieveUserGroupByName(groupName);
 
         Set<Role> roles;
         if (adminDao.isAdmin(username)
                 || userGroupService.isUserGroupAdmin(username, userGroup)) {
-            //            accessList = accessDao.retrieveAllAccessByGroup(userGroup.getId());
-            roles = roleDao.retrieveRoleByGroupId(userGroup.getId(), true);
+            roles = roleDao.retrieveRoleByGroupId(userGroup.getId(), hasQuery);
 
         }
         else {
diff --git a/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java b/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java
index 879963e..cb1ceda 100644
--- a/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java
+++ b/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java
@@ -9,7 +9,7 @@
 
 import de.ids_mannheim.korap.constant.OAuth2Scope;
 import de.ids_mannheim.korap.constant.QueryType;
-import de.ids_mannheim.korap.dto.QueryAccessDto;
+import de.ids_mannheim.korap.dto.RoleDto;
 import de.ids_mannheim.korap.dto.QueryDto;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
@@ -27,6 +27,7 @@
 import de.ids_mannheim.korap.web.utils.ResourceFilters;
 import jakarta.ws.rs.Consumes;
 import jakarta.ws.rs.DELETE;
+import jakarta.ws.rs.DefaultValue;
 import jakarta.ws.rs.GET;
 import jakarta.ws.rs.POST;
 import jakarta.ws.rs.PUT;
@@ -413,14 +414,15 @@
      */
     @GET
     @Path("access")
-    public List<QueryAccessDto> listRoles (
-            @Context SecurityContext securityContext,
-            @QueryParam("groupName") String groupName) {
+    public List<RoleDto> listRoles (@Context SecurityContext securityContext,
+            @QueryParam("groupName") String groupName,
+            @DefaultValue("true") @QueryParam("hasQuery") boolean hasQuery) {
         TokenContext context = (TokenContext) securityContext
                 .getUserPrincipal();
         try {
             scopeService.verifyScope(context, OAuth2Scope.VC_ACCESS_INFO);
-            return service.listRolesByGroup(context.getUsername(), groupName);
+            return service.listRolesByGroup(context.getUsername(), groupName,
+                    hasQuery);
         }
         catch (KustvaktException e) {
             throw kustvaktResponseHandler.throwit(e);
diff --git a/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusAccessTest.java b/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusAccessTest.java
index 08b511b..b2f7637 100644
--- a/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusAccessTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusAccessTest.java
@@ -22,9 +22,9 @@
     private String testUser = "VirtualCorpusAccessTest";
 
     @Test
-    public void testlistAccessByNonVCAAdmin () throws KustvaktException {
+    public void testlistAccessUnauthorized () throws KustvaktException {
         createDoryGroup();
-        JsonNode node = listAccessByGroup("nemo", "dory-group");
+        JsonNode node = listRolesByGroup("nemo", "dory-group");
         assertEquals(StatusCodes.AUTHORIZATION_FAILED,
                 node.at("/errors/0/0").asInt());
         assertEquals(node.at("/errors/0/1").asText(),
@@ -32,27 +32,6 @@
         deleteGroupByName(doryGroupName, "dory");
     }
 
-    // @Test
-    // public void testlistAccessMissingId () throws KustvaktException
-    // {
-    // Response response =
-    // target().path(API_VERSION).path("vc")
-    // .path("access")
-    // .request().header(Attributes.AUTHORIZATION,
-    // HttpAuthorizationHandler
-    // .createBasicAuthorizationHeaderValue(
-    // testUser, "pass"))
-    // .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
-    // .get();
-    // String entity = response.readEntity(String.class);
-    // JsonNode node = JsonUtils.readTree(entity);
-    // assertEquals(Status.BAD_REQUEST.getStatusCode(),
-    // response.getStatus());
-    // assertEquals(StatusCodes.MISSING_PARAMETER,
-    // node.at("/errors/0/0").asInt());
-    // assertEquals("vcId", node.at("/errors/0/1").asText());
-    // }
-
     @Test
     public void testDeleteSharedVC () throws KustvaktException {
         createDoryGroup();
@@ -64,7 +43,7 @@
         String groupName = "dory-group";
         shareVCByCreator(username, vcName, groupName);
 
-        JsonNode node = listAccessByGroup(username, groupName);
+        JsonNode node = listRolesByGroup(username, groupName);
         assertEquals(1, node.size());
 //      System.out.println(node.toPrettyString());
       //        assertEquals(2, node.at("/0/queryId").asInt());
@@ -74,7 +53,7 @@
 
         // delete project VC
         deleteVC(vcName, username, username);
-        node = listAccessByGroup(username, groupName);
+        node = listRolesByGroup(username, groupName);
         assertEquals(0, node.size());
 
         deleteGroupByName(doryGroupName, "dory");
@@ -98,7 +77,7 @@
         node = retrieveVCInfo("marlin", "marlin", vcName);
         assertEquals(node.at("/type").asText(), "project");
         // list vc access by marlin
-        node = listAccessByGroup("marlin", groupName);
+        node = listRolesByGroup("marlin", groupName);
         assertEquals(1, node.size());
 
         // get access id
@@ -142,7 +121,7 @@
         Response response = deleteAccess("nemo", roleId);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
 
-        JsonNode node = listAccessByGroup("nemo", groupName);
+        JsonNode node = listRolesByGroup("nemo", groupName);
         assertEquals(0, node.size());
     }
 
diff --git a/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusControllerAdminTest.java b/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusControllerAdminTest.java
index 533c2d3..673e1cd 100644
--- a/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusControllerAdminTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusControllerAdminTest.java
@@ -174,7 +174,7 @@
         assertEquals(0, node2.size());
         createAccess(vcCreator, vcName, groupName, admin);
         
-        JsonNode node = listAccessByGroup("admin",groupName);
+        JsonNode node = listRolesByGroup("admin",groupName);
         assertEquals(1, node.size());
         String roleId = node.at("/0/roleId").asText();
         node2 = testAdminListVC_UsingAdminToken(vcCreator,
@@ -183,7 +183,7 @@
         
         Response response = deleteAccess("admin",roleId);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
-        node = listAccessByGroup("admin",groupName);
+        node = listRolesByGroup("admin",groupName);
         assertEquals(0, node.size());
         
         String json = "{\"type\": \"" + ResourceType.PRIVATE + "\"}";
diff --git a/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusPublishedTest.java b/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusPublishedTest.java
index c70414a..516b6fc 100644
--- a/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusPublishedTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusPublishedTest.java
@@ -57,7 +57,7 @@
                 node.at("/members/0/roles/0").asText());
         String groupName = node.at("/name").asText();
 
-        node = listAccessByGroup("admin", groupName);
+        node = listRolesByGroup("admin", groupName);
         assertEquals(1, node.size());
         assertEquals(vcName, node.at("/0/queryName").asText());
         assertEquals(groupName, node.at("/0/userGroupName").asText());
@@ -80,7 +80,7 @@
     
     private void testHiddenGroupNotFound (String hiddenGroupName)
             throws KustvaktException {
-        JsonNode node = listAccessByGroup("admin", hiddenGroupName);
+        JsonNode node = listRolesByGroup("admin", hiddenGroupName);
         assertEquals(StatusCodes.NO_RESOURCE_FOUND,
                 node.at("/errors/0/0").asInt());
         assertEquals("Group " + hiddenGroupName + " is not found",
@@ -122,7 +122,7 @@
         
         testDeletePublishedVC("marlin",vcName,"marlin", groupName);
         
-        node = listAccessByGroup("admin", marlinGroupName);
+        node = listRolesByGroup("admin", marlinGroupName);
         assertEquals(0, node.size());
         
         deleteGroupByName(marlinGroupName, "marlin");
@@ -144,7 +144,7 @@
         assertEquals(4, node.size());
         
         // check marlin-group access
-        node = listAccessByGroup("admin", marlinGroupName);
+        node = listRolesByGroup("admin", marlinGroupName);
         assertEquals(1, node.size());
         assertEquals(vcName, node.at("/0/queryName").asText());
         assertEquals(marlinGroupName, node.at("/0/userGroupName").asText());
@@ -153,7 +153,7 @@
         // check hidden group access
         node = getHiddenGroup(vcName);
         String hiddenGroupName = node.at("/name").asText();
-        node = listAccessByGroup("admin", hiddenGroupName);
+        node = listRolesByGroup("admin", hiddenGroupName);
         assertEquals(0, node.at("/0/members").size());
         
         testAddMemberAfterSharingPublishedVC(hiddenGroupName);
@@ -172,10 +172,10 @@
         node = listVC("nemo");
         assertEquals(3, node.size());
 
-        node = listAccessByGroup("admin", marlinGroupName);
+        node = listRolesByGroup("admin", marlinGroupName);
         assertEquals(3, node.at("/0/members").size());
 
-        node = listAccessByGroup("admin", hiddenGroupName);
+        node = listRolesByGroup("admin", hiddenGroupName);
         assertEquals(0, node.at("/0/members").size());
     }
     
@@ -199,7 +199,7 @@
         // check hidden group and roles
         node = getHiddenGroup(vcName);
         String hiddenGroupName = node.at("/name").asText();
-        node = listAccessByGroup("admin", hiddenGroupName);
+        node = listRolesByGroup("admin", hiddenGroupName);
         assertEquals(1, node.size());
         node = node.get(0);
         assertEquals(vcName, node.at("/queryName").asText());
diff --git a/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusSharingTest.java b/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusSharingTest.java
index 442afdc..f0dffd9 100644
--- a/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusSharingTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusSharingTest.java
@@ -66,7 +66,7 @@
         inviteMember(marlinGroupName, "marlin", "nemo");
         subscribe(marlinGroupName, "nemo");
         
-        JsonNode node = listAccessByGroup("marlin", marlinGroupName);
+        JsonNode node = listRolesByGroup("marlin", marlinGroupName);
         assertEquals(0, node.size());
         
         // share by member unauthorized
@@ -81,7 +81,7 @@
 
         response = shareVCByCreator("nemo", "nemo-vc", marlinGroupName);
         
-        node = listAccessByGroup("marlin", marlinGroupName);
+        node = listRolesByGroup("marlin", marlinGroupName);
         assertEquals(1, node.size());
         deleteGroupByName(marlinGroupName, "marlin");
     }
@@ -94,28 +94,32 @@
         String groupName = "DNB-group";
         Response response = createUserGroup(groupName, "DNB users", testUser);
         assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
-        listUserGroup(testUser, groupName);
+        
+        JsonNode roleNodes = listRolesByGroup(testUser, groupName, false);
+        assertEquals(5, roleNodes.size());
+        
         String memberName = "darla";
         testInviteMember(groupName, testUser, memberName);
-        subscribeToGroup(memberName, groupName);
+        subscribe(groupName, memberName);
         
-        JsonNode node = listAccessByGroup(testUser, groupName);
-        assertEquals(0, node.size());
+        roleNodes = listRolesByGroup(testUser, groupName, false);
+        assertEquals(6, roleNodes.size());
         
         // share vc to group
         shareVCByCreator(testUser, vcName, groupName);
         
         // check member roles
-        node = listAccessByGroup(testUser, groupName);
-        assertEquals(1, node.size());
+        JsonNode queryRoleNodes = listRolesByGroup(testUser, groupName);
+        assertEquals(1, queryRoleNodes.size());
         
-        deleteRoleByGroupAndQuery(testUser, vcName, groupName, testUser);
-        
-        node = listAccessByGroup(testUser, groupName);
-        assertEquals(0, node.size());
+        testDeleteQueryAccessToGroup(testUser, groupName, vcName);
         
         deleteVC(vcName, testUser, testUser);
         deleteGroupByName(groupName, testUser);
+        
+        roleNodes = listRolesByGroup(testUser, groupName, false);
+        assertEquals(StatusCodes.NO_RESOURCE_FOUND,
+                roleNodes.at("/errors/0/0").asInt());
     }
     
     @Test
@@ -141,16 +145,16 @@
         String memberName = "darla";
         response = createUserGroup(groupName, "Owid users", testUser);
         assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
-        listUserGroup(testUser, groupName);
+
         testInviteMember(groupName, testUser, memberName);
-        subscribeToGroup(memberName, groupName);
+        subscribe(groupName, memberName);
         checkMemberInGroup(memberName, testUser, groupName);
         
         // share vc to group
         shareVCByCreator(testUser, vcName, groupName);
         
         // check member roles
-        node = listAccessByGroup(testUser, groupName);
+        node = listRolesByGroup(testUser, groupName);
         assertEquals(1, node.size());
         
         // search by member
@@ -159,7 +163,7 @@
         node = JsonUtils.readTree(response.readEntity(String.class));
         assertTrue(node.at("/matches").size() > 0);
         // delete project VC
-        deleteVC(vcName, testUser, testUser);
+        testDeleteSharedVC(vcName, testUser, testUser, groupName);
         // list VC
         node = listVC(testUser);
         assertEquals(1, node.size());
@@ -183,10 +187,10 @@
         String groupName = "DNB-group";
         Response response = createUserGroup(groupName, "DNB users", testUser);
         assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
-        listUserGroup(testUser, groupName);
+        
         String memberName = "darla";
         testInviteMember(groupName, testUser, memberName);
-        subscribeToGroup(memberName, groupName);
+        subscribe(groupName, memberName);
         
         shareVC(testUser, vc1, groupName, testUser);
         shareVC(testUser, vc2, groupName, testUser);
@@ -214,32 +218,50 @@
         
         deleteGroupByName(groupName, testUser);
     }
+    
+    private void testDeleteQueryAccessToGroup (String username,
+            String groupName, String vcName) throws KustvaktException {
+        JsonNode roleNodes = listRolesByGroup(username, groupName, false);
+        assertEquals(7, roleNodes.size());
 
-    private JsonNode listUserGroup (String username, String groupName)
-            throws KustvaktException {
-        Response response = target().path(API_VERSION).path("group").request()
-                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
-                        .createBasicAuthorizationHeaderValue(username, "pass"))
-                .get();
+        // delete group role
+        deleteRoleByGroupAndQuery(username, vcName, groupName, username);
+
+        JsonNode queryRoleNodes = listRolesByGroup(username, groupName);
+        assertEquals(0, queryRoleNodes.size());
+
+        roleNodes = listRolesByGroup(username, groupName, false);
+        assertEquals(6, roleNodes.size());
+
+    }
+    
+    private void testDeleteSharedVC (String vcName, String vcCreator,
+            String username, String groupName) throws KustvaktException {
+        JsonNode node = listRolesByGroup(username, groupName);
+        assertEquals(1, node.size());
+        
+        Response response = deleteVC(vcName, vcCreator, username);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
-        String entity = response.readEntity(String.class);
-        JsonNode node = JsonUtils.readTree(entity);
-        return node;
+        
+        node = listRolesByGroup(username, groupName);
+        assertEquals(0, node.size());
     }
 
-    private void subscribeToGroup (String username, String groupName)
-            throws KustvaktException {
-        Response response = target().path(API_VERSION).path("group")
-                .path("@" + groupName).path("subscribe").request()
-                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
-                        .createBasicAuthorizationHeaderValue(username, "pass"))
-                .post(Entity.form(new Form()));
-        assertEquals(Status.OK.getStatusCode(), response.getStatus());
-    }
+//    private JsonNode listUserGroup (String username, String groupName)
+//            throws KustvaktException {
+//        Response response = target().path(API_VERSION).path("group").request()
+//                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+//                        .createBasicAuthorizationHeaderValue(username, "pass"))
+//                .get();
+//        assertEquals(Status.OK.getStatusCode(), response.getStatus());
+//        String entity = response.readEntity(String.class);
+//        JsonNode node = JsonUtils.readTree(entity);
+//        return node;
+//    }
 
     private void checkMemberInGroup (String memberName, String testUser,
             String groupName) throws KustvaktException {
-        JsonNode node = listUserGroup(testUser, groupName).get(0);
+        JsonNode node = listUserGroups(testUser).get(0);
         assertEquals(2, node.get("members").size());
         assertEquals(memberName, node.at("/members/1/userId").asText());
         assertEquals(GroupMemberStatus.ACTIVE.name(),
diff --git a/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusTestBase.java b/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusTestBase.java
index cacca06..0d179bb 100644
--- a/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusTestBase.java
+++ b/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusTestBase.java
@@ -169,10 +169,18 @@
                 .post(Entity.form(new Form()));
     }
 
-    protected JsonNode listAccessByGroup (String username, String groupName)
+    protected JsonNode listRolesByGroup (String username, String groupName)
+            throws KustvaktException {
+        return listRolesByGroup(username, groupName, true);
+    }
+    
+    protected JsonNode listRolesByGroup (String username, String groupName,
+            boolean hasQuery)
             throws KustvaktException {
         Response response = target().path(API_VERSION).path("vc").path("access")
-                .queryParam("groupName", groupName).request()
+                .queryParam("groupName", groupName)
+                .queryParam("hasQuery", hasQuery)
+                .request()
                 .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
                         .createBasicAuthorizationHeaderValue(username, "pass"))
                 .get();
