def METHOD_NAME(analysis_id, user):
    """Returns the job information of the analysis
    Parameters
    ----------
    analysis_id: int
        The analysis id
    user : qiita_db.user.User
        The user performing the request
    Returns
    -------
    dict with the jobs information
    """
    analysis = Analysis(analysis_id)
    # Check if the user actually has access to the analysis
    check_analysis_access(user, analysis)
    return {
        j.id: {'status': j.status, 'step': j.step,
               'error': j.log.msg if j.log else ""}
        for j in analysis.jobs}