Author: thomas.heute(a)jboss.com
Date: 2007-09-04 09:34:05 -0400 (Tue, 04 Sep 2007)
New Revision: 8145
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java
Log:
JBPORTAL-1668: A user with "Administrator" privileges is not able to create
resources at the root level of the CMS repo
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java 2007-09-04
11:54:12 UTC (rev 8144)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java 2007-09-04
13:34:05 UTC (rev 8145)
@@ -24,6 +24,7 @@
import java.util.Collection;
import java.util.ArrayList;
import java.util.Iterator;
+import java.util.List;
import java.util.Set;
import java.util.HashSet;
import java.util.StringTokenizer;
@@ -365,24 +366,22 @@
//that excludes this user from having access for this action
StringTokenizer st = new StringTokenizer(path,"/");
StringBuffer buffer = new StringBuffer("/");
- boolean explicitPermissionsFound = false;
+ List list = new ArrayList();
+ list.add(new String(buffer.toString()));
while(st.hasMoreTokens())
{
- buffer.append(st.nextToken());
- String currentNode = buffer.toString();
- Collection permissions = this.getPermissions(currentNode);
-
- //this is for forming the path using the next token
- if(st.hasMoreTokens())
- {
- buffer.append("/");
- }
- else
- {
- continue;
- }
-
-
+ String token = st.nextToken();
+ list.add(new String(buffer.append("/").append(token)));
+ }
+
+ boolean explicitPermissionsFound = false;
+
+ Iterator it = list.iterator();
+ while (it.hasNext())
+ {
+ String currentPath = (String)it.next();
+ Collection permissions = this.getPermissions(currentPath);
+
//perform processing for permissions explicitly set on this node
//in the path hierarchy
if(permissions!=null && !permissions.isEmpty())
@@ -405,7 +404,7 @@
)
{
String pathCriteria =
userPermission.findCriteriaValue("path");
- if(pathCriteria.equals(currentNode))
+ if(pathCriteria.equals(currentPath))
{
//this means this user has read access to this path
accessFound = true;
Show replies by date