Author: adrianc
Date: Mon Jan 11 20:06:23 2010
New Revision: 898041
URL: http://svn.apache.org/viewvc?rev=898041&view=rev
Log:
Improved permissions tree building and parsing.
Modified:
ofbiz/branches/executioncontext20091231/BranchReadMe.txt
ofbiz/branches/executioncontext20091231/framework/context/src/org/ofbiz/context/TreeBuilder.java
ofbiz/branches/executioncontext20091231/framework/context/src/org/ofbiz/context/TreeWalker.java
Modified: ofbiz/branches/executioncontext20091231/BranchReadMe.txt
URL:
http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20091231/BranchReadMe.txt?rev=898041&r1=898040&r2=898041&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20091231/BranchReadMe.txt (original)
+++ ofbiz/branches/executioncontext20091231/BranchReadMe.txt Mon Jan 11
20:06:23 2010
@@ -1,6 +1,38 @@
ExecutionContext and Security-Aware Artifacts Notes
---------------------------------------------------
+2010-01-11: The ExecutionContext implementation is fairly complete.
+
+The security-aware artifacts implementation is mostly complete
+(the AuthorizationManager CRUD methods are not written and the
+EntityListIterator is not security-aware), but its use
+in the branch is still proof-of-concept. In other words, the
+design is implemented and working, but very little of the project uses it.
+
+Some examples: The screen renderer doesn't catch the security exceptions,
+so when a user is denied access to an artifact they get the JSP error page.
+Also, the main navigation doesn't display the Example component tab because
+the Freemarker template is still checking the old-style permissions.
+
+---------------------------------------------------
+
+2010-01-05: Artifact paths now support substitution ("?")
+and wildcard ("*") path elements.
+This solves an issue that was discussed during the design - how
+to grant access to a particular artifact regardless of the
+execution path. You can see examples of their use in
+framework/security/data/SecurityData.xml and
+framework/example/data/ExampleSecurityData.xml.
+
+The Example component has been converted to the new
+security design.
+
+The Execution Context seems to fulfill all needs so far, and it
+works pretty well, so its API could be considered stable at
+this time.
+
+---------------------------------------------------
+
2009-12-31: I put this text file in the branch as a means
of keeping anyone who is interested updated on the progress
of the branch.
@@ -64,19 +96,3 @@
EntityListIterator values is not implemented due to architectural
problems.
----------------------------------------------------
-
-2010-01-05: Artifact paths now support substitution ("?")
-and wildcard ("*") path elements.
-This solves an issue that was discussed during the design - how
-to grant access to a particular artifact regardless of the
-execution path. You can see examples of their use in
-framework/security/data/SecurityData.xml and
-framework/example/data/ExampleSecurityData.xml.
-
-The Example component has been converted to the new
-security design.
-
-The Execution Context seems to fulfill all needs so far, and it
-works pretty well, so its API could be considered stable at
-this time.
Modified:
ofbiz/branches/executioncontext20091231/framework/context/src/org/ofbiz/context/TreeBuilder.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20091231/framework/context/src/org/ofbiz/context/TreeBuilder.java?rev=898041&r1=898040&r2=898041&view=diff
==============================================================================
---
ofbiz/branches/executioncontext20091231/framework/context/src/org/ofbiz/context/TreeBuilder.java
(original)
+++
ofbiz/branches/executioncontext20091231/framework/context/src/org/ofbiz/context/TreeBuilder.java
Mon Jan 11 20:06:23 2010
@@ -84,8 +84,7 @@
@Override
public void visit(WildCardNode node) {
if (this.artifactPath.hasNext()) {
- this.artifactPath.next();
- this.addChildNode(node, this.artifactPath.getCurrentPath());
+ this.addChildNode(node, this.artifactPath.next());
}
}
}
Modified:
ofbiz/branches/executioncontext20091231/framework/context/src/org/ofbiz/context/TreeWalker.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20091231/framework/context/src/org/ofbiz/context/TreeWalker.java?rev=898041&r1=898040&r2=898041&view=diff
==============================================================================
---
ofbiz/branches/executioncontext20091231/framework/context/src/org/ofbiz/context/TreeWalker.java
(original)
+++
ofbiz/branches/executioncontext20091231/framework/context/src/org/ofbiz/context/TreeWalker.java
Mon Jan 11 20:06:23 2010
@@ -18,8 +18,6 @@
*******************************************************************************/
package org.ofbiz.context;
-import java.util.Map;
-
import org.ofbiz.context.PathNode.BranchNode;
import org.ofbiz.context.PathNode.SubstitutionNode;
import org.ofbiz.context.PathNode.WildCardNode;
@@ -59,12 +57,12 @@
@Override
public void visit(WildCardNode node) {
- if (this.artifactPath.hasNext() && node.childNodes != null) {
- this.artifactPath.next();
- String currentPath =
this.artifactPath.getCurrentPath().toUpperCase();
- for (Map.Entry<String, PathNode> entry :
node.childNodes.entrySet()) {
- if (currentPath.endsWith(entry.getKey())) {
- entry.getValue().accept(this);
+ if (node.childNodes != null) {
+ while (this.artifactPath.hasNext()) {
+ String key = this.artifactPath.next().toUpperCase();
+ PathNode childNode = node.childNodes.get(key);
+ if (childNode != null) {
+ childNode.accept(this);
return;
}
}