 
 
 (defendpoint DELETE "/:id" [id]
-  ;; TODO - permissions check
   (let-404 [{:keys [can_write] :as query} (sel :one [Query :id :creator_id :public_perms] :id id)]
     (check-403 @can_write)
     (del Query :id id)))

            [metabase.db :refer :all]
            (metabase.models [hydrate :refer :all]
                             [query :refer [Query]]
                             [database :refer [Database databases-for-org]]
                             [org :refer [Org]]
                             [common :as common])



(defendpoint GET "/:id" [id]
  (let-404 [{:keys [can_read] :as query} (sel :one Query :id id)]
    (check-403 @can_read)
    (hydrate query :creator :database :can_read :can_write)))
