Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save willww64/cd22d7b36a3e7bd866f724829794cf52 to your computer and use it in GitHub Desktop.

Select an option

Save willww64/cd22d7b36a3e7bd866f724829794cf52 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