RESTExtJsServiceImpl extends RESTServiceImpl implements RESTExtJsService { @Override public String getAllResources(SecurityContext sc, String nameLike, Integer start, Integer limit) throws BadRequestWebEx { if (start == null || limit == null) { throw new BadRequestWebEx("Request parameters are missing !"); } if (LOGGER.isInfoEnabled()) { LOGGER.info("Retrieving paginated resource list (start="+start+" limit="+limit+")"); } User authUser = null; try { authUser = extractAuthUser(sc); } catch (InternalErrorWebEx ie) { LOGGER.warn("Error in validating user (this action should probably be aborted)", ie); } int page = start == 0 ? start : start / limit; try { nameLike = nameLike.replaceAll("[*]", "%"); List<ShortResource> resources = resourceService.getList(nameLike, page, limit, authUser); long count = 0; if (resources != null && resources.size() > 0) { count = resourceService.getCountByFilterAndUser(nameLike, authUser); } JSONObject result = makeJSONResult(true, count, resources, authUser); return result.toString(); } catch (BadRequestServiceEx e) { LOGGER.warn(e.getMessage(), e); JSONObject obj = makeJSONResult(false, 0, null, authUser); return obj.toString(); } }  void setResourceService(ResourceService resourceService); void setUserService(UserService userService); void setUserGroupService(UserGroupService userGroupService); @Override String getAllResources(SecurityContext sc, String nameLike,
            Integer start, Integer limit); @Override String getResourcesByCategory(SecurityContext sc, String categoryName, Integer start,
            Integer limit, boolean includeAttributes,
            boolean includeData); @Override String getResourcesByCategory(SecurityContext sc, String categoryName, String resourceNameLike, Integer start,
            Integer limit, boolean includeAttributes, boolean includeData); @Override String getResourcesByCategory(SecurityContext sc,
            String categoryName, String resourceNameLike, String extraAttributes,
            Integer start, Integer limit, boolean includeAttributes, boolean includeData); @Override ExtResourceList getExtResourcesList(SecurityContext sc, Integer start, Integer limit,
            boolean includeAttributes, boolean includeData, SearchFilter filter); @Override ExtUserList getUsersList(SecurityContext sc, String nameLike, Integer start,
            Integer limit, boolean includeAttributes); @Override ExtGroupList getGroupsList(SecurityContext sc, String nameLike, Integer start,
            Integer limit, boolean all); @Override ShortResource getResource(SecurityContext sc, long id);  }
@Test public void testGetAllResources_auth_base() throws Exception { final String CAT_NAME = "CAT000"; assertEquals(0, resourceService.getAll(null, null, buildFakeAdminUser()).size()); long u0 = restCreateUser("u0", Role.USER, "p0"); long u1 = restCreateUser("u1", Role.USER, "p1"); Category cat = createCategory(CAT_NAME); restCreateResource("r_u0_0", "x", CAT_NAME, u0); restCreateResource("r_u1_0", "x", CAT_NAME, u1); restCreateResource("r_u1_1", "x", CAT_NAME, u1); { SecurityContext sc = new SimpleSecurityContext(u0); String response = restExtJsService.getAllResources(sc, "*", 0, 1000); System.out.println("JSON " + response); JSONResult result = parse(response); assertEquals(1, result.total); assertEquals(1, result.returnedCount); assertTrue(result.names.contains("r_u0_0")); } { SecurityContext sc = new SimpleSecurityContext(u1); String response = restExtJsService.getAllResources(sc, "*", 0, 1000); System.out.println("JSON " + response); JSONResult result = parse(response); assertEquals(2, result.total); assertEquals(2, result.returnedCount); assertTrue(result.names.contains("r_u1_0")); assertTrue(result.names.contains("r_u1_1")); assertFalse(result.names.contains("r_u0_0")); } }