Minor refactoring of IsInGroup so it can take arrays and dicts
authorPeter Palfrader <peter@palfrader.org>
Sat, 1 Jun 2013 09:40:11 +0000 (11:40 +0200)
committerPeter Palfrader <peter@palfrader.org>
Sat, 1 Jun 2013 09:40:11 +0000 (11:40 +0200)
ud-generate

index 858d736..db1c077 100755 (executable)
@@ -172,7 +172,7 @@ def IsInGroup(account, allowed, current_host):
   supgroups=[]
   addGroups(supgroups, account['supplementaryGid'], account['uid'], current_host)
   for g in supgroups:
-     if allowed.has_key(g):
+     if g in allowed:
         return True
   return False