Skip to content

Instantly share code, notes, and snippets.

@kimberleehowley
Last active January 22, 2020 20:21
Show Gist options
  • Save kimberleehowley/71c311d62af19b03829b94fdbba28611 to your computer and use it in GitHub Desktop.
Save kimberleehowley/71c311d62af19b03829b94fdbba28611 to your computer and use it in GitHub Desktop.
def controllerFunction() {
def user = User.get(params.userId)
if (!userPermissionService.hasPermissionToDoThis(user) {
response.status = 403
render "User unauthorized"
return
}
def comments = commentsService.getByUser(user)
...
render finalObject as JSON
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment