'Adds aggregate group membership from group, gshadow and passwd.'

def AddGroupMemberships(self):

    self.groups = {g.name: self._Members(g) for g in self.groups.itervalues()}
    for g in self.groups.itervalues():
        for user in g.members:
            membership = self.memberships.setdefault(user, set())
            membership.add(g.gid)
    for user in self.entry.itervalues():
        user.gids = self.memberships.get(user.username)
