Skip to content

Instantly share code, notes, and snippets.

@marcpalmer
Created February 20, 2012 11:26
Show Gist options
  • Save marcpalmer/1868855 to your computer and use it in GitHub Desktop.
Save marcpalmer/1868855 to your computer and use it in GitHub Desktop.
Authentication Plugin Example
class YourController {
def authenticationService
def onlyLoggedInUsers = {
if (!authenticationService.isLoggedIn(request)) {
// Redirect or return Forbidden
response.sendError(403)
} else {
… do something
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment