Created
February 5, 2013 10:43
-
-
Save spinscale/4713664 to your computer and use it in GitHub Desktop.
spark-groovy-jrebel-closure-chain
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
def authCheck = { Request request, Response response -> | |
if (request.session().attribute('userLogin') != request.params(':name')) { | |
halt(401, "No permissions to check for ${request.params(":name")}\n") | |
} | |
} | |
get "/greet/:name", authCheck, { Request request, Response response -> | |
return "Hello " + request.params('name') + "\n" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment