BUG: group_whitelist is a set, not a scalar.

This commit is contained in:
Scott Sanderson
2015-03-22 14:51:10 -04:00
parent 77c66d8b27
commit ed94c2d774

View File

@@ -115,12 +115,15 @@ class LocalAuthenticator(Authenticator):
def check_group_whitelist(self, username):
if not self.group_whitelist:
return False
try:
group = getgrnam(self.group_whitelist)
except KeyError:
self.log.error('No such group: [%s]' % self.group_whitelist)
return False
return username in group.gr_mem
for group in self.group_whitelist:
try:
group = getgrnam(self.group_whitelist)
except KeyError:
self.log.error('No such group: [%s]' % self.group_whitelist)
continue
if username in group.gr_mem:
return True
return False
@gen.coroutine
def add_user(self, user):