               (reduce (fn [permissions-acc permission]
                         (conj permissions-acc
                               (ContentPermission.
-                               (content-capability (val (first permission)))
+                               (->content-capability (val (first permission)))
                                (key (first permission)))))
                       []
                       permissions)))

    (let [xs [[:buffer-size #(.setBufferSize cco %)]
              [:collections #(.setCollections cco (into-array String %))]
              [:encoding    #(.setEncoding cco %)]
              [:format      #(.setFormat cco (doc-format %))]
              [:graph       #(.setGraph cco %)]
              [:language    #(.setLanguage cco %)]
              [:locale      #(.setLocale cco %)]

;;;; Type conversion
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defn java->num
  "Reads a number from a numeric Java object of a type from
  com.marklogic.xcc.types. Returns nil if not a number. Designed for
  robust number-handling while preventing read-string security
