noir-clojure / lib-noir

A set of libraries for ring apps, including stateful sessions.
Eclipse Public License 1.0
483 stars 47 forks source link

def-restricted-routes doesn't work with routes grouped by context #104

Closed johncowie closed 9 years ago

johncowie commented 10 years ago

The def-restricted-routes macro does not currently work when rewriting routes that are nested with Compojure's context function.

Ideally, it'd be nice to be able to do this:

(def-restricted-routes secure-routes
  (context "/users" []
    (context "/:user" [user]
      (GET "/" [] (render-user user))
      (POST "/edit" {params :params} (edit-user user params)))))
yogthos commented 10 years ago

That's a good point, I'll have to see how tricky it would be to add this.

yogthos commented 9 years ago

@johncowie I just updated the macro to walk the forms so this case should work in the latest version 0.8.6, if you could confirm that it works as expected we could close this.

johncowie commented 9 years ago

Sorry for slow reply - have incorporated the update into our code and it works perfectly. Thanks!