   :allowed-methods #{:get :post}
   :available-media-types ["application/json" "application/edn"]
   :known-content-type? #{"application/edn"}
-  :authorized? (authorized? store :programme)
-  :allowed? (allowed? store :programme)
+  :authorized? (authorized? store)
+  :allowed? (allowed? store)
   :handle-ok (partial index-handle-ok store)
   :post! (partial index-post! store)
   :handle-created (partial index-handle-created))

  (db/with-session [session (:hecuba-session store)]
    (let [request (:request ctx)
          items   (db/execute session (hayt/select :programmes))]
      (log/infof "index-handle-ok ctx: %s" ctx)
      (map #(-> %
                (dissoc :user_id)
                (assoc :href (format programme-resource (:id %))

(ns kixi.hecuba.api.programmes
  (:require
   [clojure.tools.logging :as log]
   [liberator.core :refer (defresource)]
   [liberator.representation :refer (ring-response)]
   [qbits.hayt :as hayt]
   [cheshire.core :as json]
   [cemerick.friend :as friend]
   [kixi.hecuba.security :as sec]
   [kixi.hecuba.webutil :as util]
   [kixi.hecuba.webutil :refer (decode-body authorized? allowed? uuid stringify-values sha1-regex routes-from)]
   [kixi.hecuba.storage.db :as db]
   [kixi.hecuba.storage.sha1 :as sha1]
   [kixi.hecuba.web-paths :as p]))
