 ; NOTE: http://clojuredocs.org/ring/ring.util.response/redirect
 
 ; TODO: these should be variable arity
-(defn response-403
+(defn- response-403
   [session message back-link back-msg]
   (let [
     session-info (cbauth/make-session-info session)

       :session session}))

  (GET ["/admin/edit/post/:id" :id #"[0-9]+"]
    {session :session, params :params}
    (let [
      session-info (cbauth/make-session-info session)
      authorized (cbauth/admin? session)]

        (response-403 session "You must first log in to compose new posts." nil nil))))

  (GET ["/admin/delete/post/:id" :id #"[0-9]+"]
    {session :session, params :params, uri :uri} 
    (if (cbauth/admin? session) 
      {:body (cbblog/post-delete! session params)
        :session session} 
      (response-403 session "You must first log in to delete posts." nil nil)))

  (POST "/admin/submit/post"
    {session :session, params :params, uri :uri}
    (if (cbauth/admin? session) 
      {:body (cbblog/post-npsubmit! session params)
        :session session}
