コード例 #1
0
ファイル: views.py プロジェクト: brlogan/crits
def indicator(request, indicator_id):
    """
    Generate Indicator Details template.

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :param indicator_id: The ObjectId of the indicator to get details for.
    :type indicator_id: str
    :returns: :class:`django.http.HttpResponse`
    """

    user = request.user

    if user.has_access_to(IndicatorACL.READ):
        template = "indicator_detail.html"
        (new_template, args) = get_indicator_details(indicator_id,
                                                     user)
        if new_template:
            template = new_template
        return render_to_response(template,
                                  args,
                                  RequestContext(request))
    else:
        return render_to_response("error.html",
                                  {'error': 'User does not have permission to view Indicator details.'},
                                  RequestContext(request))
コード例 #2
0
def indicator(request, indicator_id):
    """
    Generate Indicator Details template.

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :param indicator_id: The ObjectId of the indicator to get details for.
    :type indicator_id: str
    :returns: :class:`django.http.HttpResponse`
    """

    analyst = request.user.username
    template = "indicator_detail.html"
    (new_template, args) = get_indicator_details(indicator_id, analyst)
    if new_template:
        template = new_template
    return render_to_response(template, args, RequestContext(request))
コード例 #3
0
ファイル: views.py プロジェクト: robertsjw/crits
def indicator(request, indicator_id):
    """
    Generate Indicator Details template.

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :param indicator_id: The ObjectId of the indicator to get details for.
    :type indicator_id: str
    :returns: :class:`django.http.HttpResponse`
    """

    analyst = request.user.username
    template = "indicator_detail.html"
    (new_template, args) = get_indicator_details(indicator_id, analyst)
    if new_template:
        template = new_template
    return render_to_response(template, args, RequestContext(request))
コード例 #4
0
def indicator(request, indicator_id):
    """
    Generate Indicator Details template.

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :param indicator_id: The ObjectId of the indicator to get details for.
    :type indicator_id: str
    :returns: :class:`django.http.HttpResponse`
    """

    user = request.user

    if user.has_access_to(IndicatorACL.READ):
        template = "indicator_detail.html"
        (new_template, args) = get_indicator_details(indicator_id, user)
        if new_template:
            template = new_template
        return render_to_response(template, args, RequestContext(request))
    else:
        return render_to_response("error.html", {
            'error':
            'User does not have permission to view Indicator details.'
        }, RequestContext(request))