incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject svn commit: r945035 - /sling/trunk/bundles/jcr/base/src/main/java/org/apache/sling/jcr/base/util/AccessControlUtil.java
Date Mon, 17 May 2010 09:05:06 GMT
Author: ieb
Date: Mon May 17 09:05:06 2010
New Revision: 945035

URL: http://svn.apache.org/viewvc?rev=945035&view=rev
Log:
SLING-1522 Removed unnecessary binding to Authorizables when manipulating ACLs

Modified:
    sling/trunk/bundles/jcr/base/src/main/java/org/apache/sling/jcr/base/util/AccessControlUtil.java

Modified: sling/trunk/bundles/jcr/base/src/main/java/org/apache/sling/jcr/base/util/AccessControlUtil.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/base/src/main/java/org/apache/sling/jcr/base/util/AccessControlUtil.java?rev=945035&r1=945034&r2=945035&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/base/src/main/java/org/apache/sling/jcr/base/util/AccessControlUtil.java
(original)
+++ sling/trunk/bundles/jcr/base/src/main/java/org/apache/sling/jcr/base/util/AccessControlUtil.java
Mon May 17 09:05:06 2010
@@ -21,7 +21,6 @@ package org.apache.sling.jcr.base.util;
 import org.apache.jackrabbit.api.JackrabbitSession;
 import org.apache.jackrabbit.api.security.JackrabbitAccessControlList;
 import org.apache.jackrabbit.api.security.principal.PrincipalManager;
-import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.UserManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -364,9 +363,6 @@ public class AccessControlUtil {
     		acl.addAccessControlEntry(principal, grantedPrivilegeList.toArray(new Privilege[grantedPrivilegeList.size()]));
     	}
 
-    	//process any denied privileges
-    	UserManager userManager = getUserManager(session);
-    	Authorizable authorizable = userManager.getAuthorizable(principal);
    		//add a fresh ACE with the denied privileges
    		List<Privilege> deniedPrivilegeList = new ArrayList<Privilege>();
    		for (String name : newDeniedPrivilegeNames) {
@@ -391,8 +387,8 @@ public class AccessControlUtil {
     		for (Privilege privilege : oldDenies) {
     			oldDeniedNames.add(privilege.getName());
     		}
-    		log.debug("Updated ACE for principalId {} for resource {} from grants {}, denies {}
to grants {}, denies {}", new Object [] {
-    				authorizable.getID(), resourcePath, oldGrantedNames, oldDeniedNames, newGrantedPrivilegeNames,
newDeniedPrivilegeNames
+    		log.debug("Updated ACE for principalName {} for resource {} from grants {}, denies
{} to grants {}, denies {}", new Object [] {
+    				principal.getName(), resourcePath, oldGrantedNames, oldDeniedNames, newGrantedPrivilegeNames,
newDeniedPrivilegeNames
     			});
     	}
 	}



Mime
View raw message