Skip to content

Instantly share code, notes, and snippets.

@spinscale
Created February 5, 2013 10:43
Show Gist options
  • Save spinscale/4713664 to your computer and use it in GitHub Desktop.
Save spinscale/4713664 to your computer and use it in GitHub Desktop.
spark-groovy-jrebel-closure-chain
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