':param account: example: test
:param account_user: example: test:tester
:param account_id: example: AUTH_test
:return: a comma separated string of group names. The group names are
as follows: account,account_user,groups...
If .admin is in the groups, this is replaced by all the
possible account ids. For example, for user joe, account acct
and resellers AUTH_, OTHER_, the returned string is as
follows: acct,acct:joe,AUTH_acct,OTHER_acct'

def _get_user_groups(self, account, account_user, account_id):

    groups = [account, account_user]
    groups.extend(self.users[account_user]['groups'])
    if ('.admin' in groups):
        groups.remove('.admin')
        for prefix in self._non_empty_reseller_prefixes():
            groups.append(('%s%s' % (prefix, account)))
        if (account_id not in groups):
            groups.append(account_id)
    groups = ','.join(groups)
    return groups
