    [compojure.route :as route]))
 
 (defn- validate-variable-content-type
-  "Validates that content type sent with a variable is JSON"
+  "Validates that content type sent with a variable is JSON."
   [headers]
   (mt/extract-header-mime-type #{mt/json} headers "content-type" true))
 

    :headers {"Content-Type" mt/json}}))

(defn- verify-variable-association-permission
  "Verifies the current user has been granted permission to make variable associations"
  [context permission-type]
  (when-not (seq (acl/get-permitting-acls
                  context :system-object "INGEST_MANAGEMENT_ACL" permission-type))
    (errors/throw-service-error
      :unauthorized
      (format "You do not have permission to %s a variable." (name permission-type)))))

(defn associate-variable-to-collections
  "Associate the variable to a list of collections."
  [context headers body variable-concept-id]
  (verify-variable-association-permission context :update)
  (common-enabled/validate-write-enabled context "search")
  (validate-variable-content-type headers)
  (info (format "Associate variable [%s] on collections: %s by client: %s."

   [cheshire.core :as json]
   [cmr.acl.core :as acl]
   [cmr.common-app.api.enabled :as common-enabled]
   [cmr.common.concepts :as concepts]
   [cmr.common.log :refer (debug info warn error)]
   [cmr.common.mime-types :as mt]
   [cmr.common.services.errors :as errors]
