Skip to content

Instantly share code, notes, and snippets.

@jhinrichsen
Created August 3, 2016 06:37
Show Gist options
  • Save jhinrichsen/398677039f603ced9816abb70faa44bd to your computer and use it in GitHub Desktop.
Save jhinrichsen/398677039f603ced9816abb70faa44bd to your computer and use it in GitHub Desktop.
def isAuthenticated(User u) {
try {
return u.impersonate().isAuthenticated()
}
// Users pulled from SCM history e.a. are not GUI users
catch (org.acegisecurity.userdetails.UsernameNotFoundException xc) {
return false
}
}
User.getAll().findAll { isAuthenticated(it) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment