Created
October 22, 2013 18:35
-
-
Save thefringeninja/7105713 to your computer and use it in GitHub Desktop.
Words fail.
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
private static IEnumerable<string> AreYouSerious(UserPrincipal identity) | |
{ | |
var enumerator = identity.GetAuthorizationGroups().GetEnumerator(); | |
while (enumerator.MoveNext()) | |
{ | |
Principal authorizationGroup = null; | |
try | |
{ | |
authorizationGroup = enumerator.Current; | |
} | |
catch | |
{ | |
} | |
if (authorizationGroup != null) | |
{ | |
yield return authorizationGroup.Name; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment