@csrf_protect
def render_flatpage(request, f):
    # If registration is required for accessing this page, and the user isn't
    # logged in, redirect to the login page.
    if f.registration_required and not request.user.is_authenticated():
        from django.contrib.auth.views import redirect_to_login
        return redirect_to_login(request.path)
    if f.template_name:
        t = loader.select_template((f.template_name, DEFAULT_TEMPLATE))
    else:
        t = loader.get_template(DEFAULT_TEMPLATE)

    # To avoid having to always use the "|safe" filter in flatpage templates,
    # mark the title and content as already safe (since they are raw HTML
    # content in the first place).
    f.title = mark_safe(f.title)
    f.content = mark_safe(f.content)

    c = RequestContext(request, {
        'flatpage': f,
    })
    response = HttpResponse(t.render(c))
    populate_xheaders(request, response, FlatPage, f.id)
    return response
simulate behaviour of group 4 member
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/contrib/flatpages/views.py/render_flatpage--crossover with--dataset/ETHPy150Open divio/django-cms/cms/tests/test_menu_page_viewperm_staff.py/ViewPermissionComplexMenuStaffNodeTests.test_node_staff_access_descendants_group_4