clerezza-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r981486 - /incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.content/src/main/java/org/apache/clerezza/platform/content/hierarchy/HierarchyService.java
Date Mon, 02 Aug 2010 12:41:34 GMT
Author: mir
Date: Mon Aug  2 12:41:34 2010
New Revision: 981486

URL: http://svn.apache.org/viewvc?rev=981486&view=rev
Log:
code that would require system.graph read permission is now executed in a privileged block.

Modified:
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.content/src/main/java/org/apache/clerezza/platform/content/hierarchy/HierarchyService.java

Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.content/src/main/java/org/apache/clerezza/platform/content/hierarchy/HierarchyService.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.content/src/main/java/org/apache/clerezza/platform/content/hierarchy/HierarchyService.java?rev=981486&r1=981485&r2=981486&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.content/src/main/java/org/apache/clerezza/platform/content/hierarchy/HierarchyService.java
(original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.content/src/main/java/org/apache/clerezza/platform/content/hierarchy/HierarchyService.java
Mon Aug  2 12:41:34 2010
@@ -37,6 +37,8 @@ import org.osgi.service.component.Compon
 
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.*;
 import java.util.concurrent.locks.Lock;
 
@@ -482,9 +484,15 @@ public class HierarchyService {
 	}
 
 	protected GraphNode getCreator() {
-		String userName = UserUtil.getCurrentUserName();
+		final String userName = UserUtil.getCurrentUserName();
 		if (userName != null) {
-			return userManager.getUserGraphNode(userName);
+			return AccessController.doPrivileged(new PrivilegedAction<GraphNode>() {
+
+				@Override
+				public GraphNode run() {
+					return userManager.getUserGraphNode(userName);
+				}
+			});
 		}
 		return null;
 	}



Mime
View raw message