def sanitize_releasability(releasability, user_sources):
    """
    Remove any releasability that is for sources a user does not have access to
    see.

    :param releasability: The releasability list for a top-level object.
    :type releasability: list
    :param user_sources: The sources a user has access to.
    :type user_sources: list
    :returns: list
    """

    # currently this uses dictionary lookups.
    # when we move to classes, this should use attributes
    return [r for r in releasability if r['name'] in user_sources]