             (func mesg))))
       (.subscribe (get-channel servlet channel) client))))
 
+;;;; Security ;;;;
+
+(comment
+(defn allowed-to?)
+
+(defn create-security-policy
+  "Create a extensible security policy for an existing cometd servlet."
+  [servlet]
+  (.. servlet
+      (getBayeux)
+      (setSecurityPolicy
+        (proxy SecurityPolicy
+          (canPublish [])))))
+
+(defn deny-subscribe
+  "Deny subscription requests matching a predicate."
+  [pred])
+  
+
+(defn deny-publish
+  [pred])
+
+)

  ([client channel message]
    (publish *cometd* client channel message))
  ([servlet client channel message]
    (.publish (get-channel servlet channel) client message nil)))

(defn subscribe
  "Subscribe to a channel."

;; compojure.cometd
;;
;; An interface to Jetty's cometd implementation

(ns compojure.cometd
  (:use    (compojure json))
  (:import (dojox.cometd MessageListener)
           (org.mortbay.cometd.continuation ContinuationCometdServlet)
           (org.mortbay.util.ajax JSON$Generator)))

(def *cometd*
  (new ContinuationCometdServlet))
