You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by as...@apache.org on 2016/04/19 08:55:21 UTC
svn commit: r1739857 -
/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/serversidetests/ResourceResolverTest.java
Author: asanso
Date: Tue Apr 19 06:55:21 2016
New Revision: 1739857
URL: http://svn.apache.org/viewvc?rev=1739857&view=rev
Log:
SLING-5638 - Sling:alias property not working if user does not have read access to the root node
* delete commented test
Modified:
sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/serversidetests/ResourceResolverTest.java
Modified: sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/serversidetests/ResourceResolverTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/serversidetests/ResourceResolverTest.java?rev=1739857&r1=1739856&r2=1739857&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/serversidetests/ResourceResolverTest.java (original)
+++ sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/serversidetests/ResourceResolverTest.java Tue Apr 19 06:55:21 2016
@@ -2667,71 +2667,6 @@ public class ResourceResolverTest {
}
}
- /*@Test public void test_resolve_with_sling_alias_limited_access() throws Exception {
- Principal testUserPrincipal = AccessControlUtil.getPrincipalManager(session).getPrincipal("testuser");
-
- Node child = rootNode.addNode("child");
- child.setProperty("sling:alias", "kind");
- AccessControlUtil.replaceAccessControlEntry(session, child.getPath(), testUserPrincipal, null, new String[] {"jcr:all"}, null, "last");
- session.save();
-try {
- Session testUserSession = getRepository().login(new SimpleCredentials("testuser", "test".toCharArray()));
- final Map<String, Object> authInfo = new HashMap<String, Object>();
- authInfo.put(ResourceResolverFactory.USER, "admin");
- authInfo.put(ResourceResolverFactory.PASSWORD, "admin".toCharArray());
- authInfo.put("testAttributeString", "AStringValue");
- authInfo.put("testAttributeNumber", 999);
- ResourceResolver testUserResolver = resFac.getResourceResolver(authInfo);
-
- try {
- // expect child due to the aliased not not being visible and no parent
- // due to mapping the rootPath onto root
- String path = "/child";
- String mapped = testUserResolver.map(child.getPath());
- assertEquals(path, mapped);
-
- Resource res = testUserResolver.resolve(null, path);
- assertNotNull(res);
- assertTrue(res instanceof NonExistingResource);
- assertEquals("/child",
- res.getResourceMetadata().getResolutionPath());
- // TODO - is this correct?
- assertEquals(null, res.getResourceMetadata().getResolutionPathInfo());
-
- // second level alias
- Node grandchild = child.addNode("grandchild");
- grandchild.setProperty("sling:alias", "enkel");
- AccessControlUtil.replaceAccessControlEntry(session, grandchild.getPath(), testUserPrincipal, new String[] { "jcr:all" }, null, null, "first");
- session.save();
-
- // expect /child/enkel due to parent node not being
- // visible to the test user and no parent due to mapping
- // the rootPath onto root
- String pathEnkel = "/child/enkel";
- String mappedEnkel = testUserResolver.map(grandchild.getPath());
- assertEquals(pathEnkel, mappedEnkel);*/
-
- //TODO already commented
- /*
- Resource resEnkel = testUserResolver.resolve(null, pathEnkel);
- assertNotNull(resEnkel);
- assertEquals(rootNode.getPath() + "/kind/enkel",
- resEnkel.getResourceMetadata().getResolutionPath());
- assertEquals("", resEnkel.getResourceMetadata().getResolutionPathInfo());
-
- Node resNodeEnkel = resEnkel.adaptTo(Node.class);
- assertNotNull(resNodeEnkel);
- assertEquals(grandchild.getPath(), resNodeEnkel.getPath());
- */
- /*} finally {
- testUserSession.logout();
- }
- } finally {
- child.remove();
- session.save();
- }
- }*/
-
@Test public void test_resolve_with_sling_alias_limited_access() throws Exception {
Principal testUserPrincipal = new Principal() {