jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1525822 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/AbstractRepositoryTest.java
Date Tue, 24 Sep 2013 09:31:21 GMT
Author: angela
Date: Tue Sep 24 09:31:21 2013
New Revision: 1525822

URL: http://svn.apache.org/r1525822
Log:
OAK-680 : AbstractRepositoryTest: missing proper permission setup

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/AbstractRepositoryTest.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/AbstractRepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/AbstractRepositoryTest.java?rev=1525822&r1=1525821&r2=1525822&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/AbstractRepositoryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/AbstractRepositoryTest.java
Tue Sep 24 09:31:21 2013
@@ -18,12 +18,15 @@ package org.apache.jackrabbit.oak.jcr;
 
 import java.util.Arrays;
 import java.util.Collection;
-
+import javax.jcr.GuestCredentials;
 import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.SimpleCredentials;
+import javax.jcr.security.Privilege;
 
+import org.apache.jackrabbit.commons.jackrabbit.authorization.AccessControlUtils;
+import org.apache.jackrabbit.oak.spi.security.principal.EveryonePrincipal;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 import org.junit.After;
 import org.junit.Ignore;
@@ -90,9 +93,10 @@ public abstract class AbstractRepository
     }
 
     protected Session createAnonymousSession() throws RepositoryException {
-        // FIXME: provider proper permission setup for the anonymous session (e.g. full read
access)
-        // return getRepository().login(new GuestCredentials());
-        return createAdminSession();
+        Session admin = getAdminSession();
+        AccessControlUtils.addAccessControlEntry(admin, "/", EveryonePrincipal.getInstance(),
new String[] {Privilege.JCR_READ}, true);
+        admin.save();
+        return getRepository().login(new GuestCredentials());
     }
 
     protected Session createAdminSession() throws RepositoryException {



Mime
View raw message