Created
August 3, 2016 06:37
-
-
Save jhinrichsen/398677039f603ced9816abb70faa44bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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