'Get a list of roles for this group on domain and/or project.'

def get_roles_for_groups(self, group_ids, project_id=None, domain_id=None):

    if (not group_ids):
        return []
    if (project_id is not None):
        self.resource_api.get_project(project_id)
        assignment_list = self.list_role_assignments(source_from_group_ids=group_ids, project_id=project_id, effective=True)
    elif (domain_id is not None):
        assignment_list = self.list_role_assignments(source_from_group_ids=group_ids, domain_id=domain_id, effective=True)
    else:
        raise AttributeError(_('Must    specify    either    domain    or    project'))
    role_ids = list(set([x['role_id'] for x in assignment_list]))
    return self.role_api.list_roles_from_ids(role_ids)
