'Toggles unit access to the groups in group_ids'

def toggle_unit_access(self, partition_name, group_ids):

    if group_ids:
        modal = self.edit()
        groups_select = self.q(css='.group-select-title    select')
        select_option_by_text(groups_select, partition_name)
        for group_id in group_ids:
            checkbox = self.q(css='#content-group-{group_id}'.format(group_id=group_id))
            checkbox.click()
        modal.save()
