Skip to content

Instantly share code, notes, and snippets.

@christianberg
Created June 9, 2010 11:09
Show Gist options
  • Save christianberg/431336 to your computer and use it in GitHub Desktop.
Save christianberg/431336 to your computer and use it in GitHub Desktop.
(defn wrap-requiring-admin [application]
(fn [request]
(let [{:keys [user-service]} (users/user-info request)]
(if (.isUserAdmin user-service)
(application request)
{:status 403 :body "Access denied. You must be logged in as admin user!"}))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment