jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1455451 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/privilege/PrivilegeRegistrationTest.java
Date Tue, 12 Mar 2013 09:00:59 GMT
Author: angela
Date: Tue Mar 12 09:00:59 2013
New Revision: 1455451

URL: http://svn.apache.org/r1455451
Log:
OAK-527: permissions (wip, make sure test setup grantes read-access to guest-session)

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/privilege/PrivilegeRegistrationTest.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/privilege/PrivilegeRegistrationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/privilege/PrivilegeRegistrationTest.java?rev=1455451&r1=1455450&r2=1455451&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/privilege/PrivilegeRegistrationTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/privilege/PrivilegeRegistrationTest.java
Tue Mar 12 09:00:59 2013
@@ -34,9 +34,11 @@ import javax.jcr.security.AccessControlE
 import javax.jcr.security.Privilege;
 
 import org.apache.jackrabbit.api.security.authorization.PrivilegeManager;
+import org.apache.jackrabbit.commons.jackrabbit.authorization.AccessControlUtils;
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
 import org.apache.jackrabbit.oak.jcr.Jcr;
 import org.apache.jackrabbit.oak.security.privilege.PrivilegeConstants;
+import org.apache.jackrabbit.oak.spi.security.principal.EveryonePrincipal;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -64,6 +66,13 @@ public class PrivilegeRegistrationTest e
         session = getAdminSession();
         privilegeManager = getPrivilegeManager(session);
 
+        // make sure the guest session has read access
+        try {
+            AccessControlUtils.addAccessControlEntry(session, "/", EveryonePrincipal.getInstance(),
new String[]{Privilege.JCR_READ}, true);
+            session.save();
+        } catch (RepositoryException e) {
+            // failed to initialize
+        }
     }
     @After
     public void tearDown() throws Exception {



Mime
View raw message