jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1603769 - /jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/jackrabbit/authorization/AccessControlUtils.java
Date Thu, 19 Jun 2014 09:05:52 GMT
Author: angela
Date: Thu Jun 19 09:05:51 2014
New Revision: 1603769

URL: http://svn.apache.org/r1603769
Log:
JCR-3789 : AccessControlUtils.clear should not retrieve applicable policies

Modified:
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/jackrabbit/authorization/AccessControlUtils.java

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/jackrabbit/authorization/AccessControlUtils.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/jackrabbit/authorization/AccessControlUtils.java?rev=1603769&r1=1603768&r2=1603769&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/jackrabbit/authorization/AccessControlUtils.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/jackrabbit/authorization/AccessControlUtils.java
Thu Jun 19 09:05:51 2014
@@ -282,7 +282,14 @@ public class AccessControlUtils {
      */
     public static boolean clear(Session session, String absPath, String principalName) throws
RepositoryException {
         AccessControlManager acm = session.getAccessControlManager();
-        JackrabbitAccessControlList acl = getAccessControlList(acm, absPath);
+        JackrabbitAccessControlList acl = null;
+        // only clear if there is an existing acl (no need to retrieve applicable policies)
+        AccessControlPolicy[] pcls = acm.getPolicies(absPath);
+        for (AccessControlPolicy policy : pcls) {
+            if (policy instanceof JackrabbitAccessControlList) {
+                acl = (JackrabbitAccessControlList) policy;
+            }
+        }
         if (acl != null) {
             if (principalName == null) {
                 acm.removePolicy(absPath, acl);



Mime
View raw message