[Yanel-commits] rev 33165 -
public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/security/gwt/accesspolicyeditor/client
michi at wyona.com
michi at wyona.com
Mon Mar 10 14:06:05 CET 2008
Author: michi
Date: 2008-03-10 14:06:04 +0100 (Mon, 10 Mar 2008)
New Revision: 33165
Modified:
public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/security/gwt/accesspolicyeditor/client/AsynchronousPolicyGetter.java
Log:
parse rights
Modified: public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/security/gwt/accesspolicyeditor/client/AsynchronousPolicyGetter.java
===================================================================
--- public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/security/gwt/accesspolicyeditor/client/AsynchronousPolicyGetter.java 2008-03-10 13:05:12 UTC (rev 33164)
+++ public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/security/gwt/accesspolicyeditor/client/AsynchronousPolicyGetter.java 2008-03-10 13:06:04 UTC (rev 33165)
@@ -74,15 +74,33 @@
NodeList userElements = rootElement.getElementsByTagName("user");
for (int i = 0; i < userElements.getLength(); i++) {
- String[] rights = {"Write", "Read"};
+ Element userE = (Element) userElements.item(i);
+
+ NodeList rightElements = userE.getElementsByTagName("right");
+ String[] rights = new String[rightElements.getLength()];
+ for (int k = 0; k < rights.length; k++) {
+ Element rightE = (Element) rightElements.item(k);
+ rights[k] = rightE.getAttribute("id");
+ //Window.alert("User Right: " + rights[k]);
+ }
+
users.add(new User(((Element) userElements.item(i)).getAttribute("id"), rights));
//Window.alert("User: " + ((User) users.elementAt(users.size() - 1)).getId());
}
NodeList groupElements = rootElement.getElementsByTagName("group");
for (int i = 0; i < groupElements.getLength(); i++) {
- String[] rights = {"Write", "Read"};
- groups.add(new Group(((Element) groupElements.item(i)).getAttribute("id"), rights));
+ Element groupE = (Element) groupElements.item(i);
+
+ NodeList rightElements = groupE.getElementsByTagName("right");
+ String[] rights = new String[rightElements.getLength()];
+ for (int k = 0; k < rights.length; k++) {
+ Element rightE = (Element) rightElements.item(k);
+ rights[k] = rightE.getAttribute("id");
+ //Window.alert("Group Right: " + rights[k]);
+ }
+
+ groups.add(new Group(groupE.getAttribute("id"), rights));
//Window.alert("Group: " + ((Group) groups.elementAt(groups.size() - 1)).getId());
}
More information about the Yanel-commits
mailing list