@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"));
    }
}