GeoStoreClient { public void updateSecurityRules(Long resourceId, SecurityRuleList rules) { getBaseWebResource("resources", "resource", resourceId, "permissions") .header("Content-Type", MediaType.TEXT_XML) .accept(MediaType.TEXT_PLAIN) .post(rules); } GeoStoreClient(); @Deprecated ShortResourceList searchResources(SearchFilter searchFilter); ResourceList searchResources(SearchFilter searchFilter,
            Integer page, Integer entries,
            Boolean includeAttributes, Boolean includeData); Long insert(RESTResource resource); Resource getResource(Long id, boolean full); Resource getResource(Long id); void deleteResource(Long id); void updateResource(Long id, RESTResource resource); ShortResourceList getAllShortResource(Integer page, Integer entries); SecurityRuleList getSecurityRules(Long resourceId); void updateSecurityRules(Long resourceId, SecurityRuleList rules); String getData(Long id); String getData(Long id, MediaType acceptMediaType); byte[] getRawData(Long id, RawFormat decodeFrom); T getRawData(Class<T> clazz, Long id, RawFormat decodeFrom); void setData(Long id, String data); void updateData(Long id, String data); Long insert(RESTCategory category); Category getCategory(Long id); Long getCategoryCount(String nameLike); CategoryList getCategories(Integer page, Integer entries); CategoryList getCategories(); void deleteCategory(Long id); ExtGroupList searchUserGroup(Integer start,Integer limit, String nameLike, boolean all); ExtGroupList searchUserGroup(Integer start,Integer limit, String nameLike); ShortResource getShortResource(long id); String getPassword(); void setPassword(String password); String getUsername(); void setUsername(String username); String getGeostoreRestUrl(); void setGeostoreRestUrl(String geostoreRestUrl);  }
@Test public void testupdateSecurityRules() { createDefaultCategory(); RESTResource res = new RESTResource(); res.setCategory(new RESTCategory(DEFAULTCATEGORYNAME)); String timeid = Long.toString(System.currentTimeMillis()); res.setName("rest_test_resource_" + timeid); Long userId = createUser("u1_" + timeid, Role.USER, "---"); UserGroup g1 = new UserGroup(); g1.setGroupName("g1_" + timeid); Long groupId = adminClient.insertUserGroup(g1); Long id = client.insert(res); List<SecurityRule> ruleList = new ArrayList<SecurityRule>(); SecurityRule rule = new SecurityRule(); rule.setCanRead(true); rule.setCanWrite(true); User user = new User(); user.setId(userId); rule.setUser(user); ruleList.add(rule); rule = new SecurityRule(); rule.setCanRead(true); rule.setCanWrite(false); UserGroup group = new UserGroup(); group.setId(groupId); rule.setGroup(group); ruleList.add(rule); SecurityRuleList rules = new SecurityRuleList(ruleList); client.updateSecurityRules(id, rules); SecurityRuleList writtenRules = client.getSecurityRules(id); assertNotNull(writtenRules.getList()); assertEquals(2, rules.getList().size()); }