def has_spdx_licenses(resource):
    """
    Return True if a Resource licenses are all known SPDX licenses.
    """
    if resource.scan_errors:
        return False

    for detected_license in resource.licenses:
        if not detected_license.get('spdx_license_key'):
            return False
    return True