   (nth access-levels idx))
 
 (defn- access-level-to-index [access-level]
-  (case access-level
-    reader-level 0
-    owner-level 1
-    no-access-level 2))
+  (cond
+    (= "READER" access-level) 0
+    (= "OWNER" access-level) 1
+    (= "NO ACCESS" access-level) 2
+    :else (do  (utils/rlog (str "Unknown access-level :'" access-level "'"))  reader-level)))
+
 
 (def ^:private column-width "calc(50% - 4px)")
 

                                                         (:background-gray style/colors))}
                              :disabled (< i (:count-orig @state))
                              :spellCheck false
                              :defaultValue (:user acl-entry)
                              :onChange (fn [e]
                                          (let [new-val (-> e .-target .-value)
                                                new-val-is-public (= "public" new-val)]
                                            (when new-val-is-public
                                              (do
                                                (js/alert "Cannot set value to 'public'!  Use the check-box instead.")
                                                (set! (-> e .-target .-value) "")))))})
                           (style/create-select
                             {:ref (str "acl-value" i)
                              :style {:float "right" :width column-width :height 33}

        ;if public is in the acl return the value of the last one
        lastPublicAccessLevel))))



(defn- validate-user [acl-map]
  (let [user (acl-map :user)]
    (not (= "public" user))))


(react/defc AgoraPermsEditor
