[Yanel-commits] rev 31475 - public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/yanel/gwt/accesspolicyeditor/client

michi at wyona.com michi at wyona.com
Fri Feb 8 01:02:55 CET 2008


Author: michi
Date: 2008-02-08 01:02:54 +0100 (Fri, 08 Feb 2008)
New Revision: 31475

Modified:
   public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/yanel/gwt/accesspolicyeditor/client/PolicyListBoxWidget.java
Log:
get rights fixed

Modified: public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/yanel/gwt/accesspolicyeditor/client/PolicyListBoxWidget.java
===================================================================
--- public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/yanel/gwt/accesspolicyeditor/client/PolicyListBoxWidget.java	2008-02-07 23:56:53 UTC (rev 31474)
+++ public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/yanel/gwt/accesspolicyeditor/client/PolicyListBoxWidget.java	2008-02-08 00:02:54 UTC (rev 31475)
@@ -52,8 +52,9 @@
         lb = new ListBox(true);
         lb.addClickListener(this);
         lb.setVisibleItemCount(visibleItemCount);
-        lb.addItem("U: alice (Read, Write)");
+        lb.addItem("U: alice (Read,Write)");
         lb.addItem("U: karin (Read)");
+        lb.addItem("U: susi");
         vp.add(lb);
 
         readCB = new CheckBox("Read");
@@ -86,12 +87,14 @@
                 }
             } else {
                 Window.alert("No identity has been selected! Please select an identity in order to assign rights.");
+                readCB.setChecked(false);
+                writeCB.setChecked(false);
             }
         } else if (sender == lb) {
             int i = lb.getSelectedIndex();
             String selectedIdentity = lb.getValue(i);
 
-            Window.alert("Update check boxes!");
+            //Window.alert("Update check boxes!");
             String[] rights = getRights(selectedIdentity);
 
             boolean hasReadBeenChecked = false;
@@ -114,8 +117,12 @@
      *
      */
     private String[] getRights(String identity) {
-        String[] rights = new String[1];
-        rights[0] = "Read";
-        return rights;
+        if (identity.indexOf("(") > 0) {
+            String rights = identity.substring(identity.indexOf("(") + 1, identity.indexOf(")"));
+            //Window.alert("Rights: " + rights);
+            return rights.split(",");
+        } else {
+            return new String[0];
+        }
     }
 }



More information about the Yanel-commits mailing list