'look for queue entries that aren\'t abortable, meaning
* the job isn\'t owned by this user, and
* the machine isn\'t ACL-accessible, or
* the machine is in the "Everyone" ACL'

@staticmethod
def check_abort_permissions(queue_entries):

    user = User.current_user()
    if user.is_superuser():
        return
    not_owned = queue_entries.exclude(job__owner=user.login)
    accessible_ids = set((entry.id for entry in not_owned.filter(host__aclgroup__users__login=user.login)))
    public_ids = set((entry.id for entry in not_owned.filter(host__aclgroup__name='Everyone')))
    cannot_abort = [entry for entry in not_owned.select_related() if ((entry.id not in accessible_ids) or (entry.id in public_ids))]
    if (len(cannot_abort) == 0):
        return
    entry_names = ',    '.join((('%s-%s/%s' % (entry.job.id, entry.job.owner, entry.host_or_metahost_name())) for entry in cannot_abort))
    raise AclAccessViolation(('You    cannot    abort    job    entries:    %s' % entry_names))
