Created
June 9, 2010 11:09
-
-
Save christianberg/431336 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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