 
 (defn resolve-href
   "Like resolve-href-keep, except that the :href attributes are removed."
-  [idmap {:keys [href] :as resource}]
+  [{:keys [href] :as resource} idmap]
   (if href
     (-> resource
         (resolve-href-keep idmap)

   resolve-href function)."
  [resource idmap & [keep?]]
  (let [f (if keep? resolve-href-keep resolve-href)]
    (w/prewalk (partial f idmap) resource)))


   If a referenced document doesn't exist or if the user doesn't have read
   access to the document, then the method will throw."
  [{:keys [href] :as resource} idmap]
  (if href
    (let [refdoc (crud/retrieve-by-id href)]
      (a/can-view? refdoc idmap)
