{% extends "govuk/govuk_template.html" %}

{% block head %}
  {% include "_stylesheets.html" %}
{% endblock %}

{% block cookie_message %}
  {% include "_cookie_message.html" %}
{% endblock %}

{% block header_class %}with-proposition{% endblock %}

{% block proposition_header %}
  {% with items = [
      {"label": "Service status changes", "link": url_for('main.service_status_update_audits')}
  ] if current_user.has_role('admin') or current_user.has_role('admin-ccs-category') else [] %}
    {% include "toolkit/proposition-header.html" %}
  {% endwith %}
{% endblock %}

{% block content %}
  {% block breadcrumb %}{% endblock %}
  <div id="wrapper">
    <main id="content" role="main">
      {% block main_content %}{% endblock %}
    </main>
  </div>
{% endblock %}

{% block footer_top %}
  {% include "_footer_categories.html" %}
{% endblock %}

{% block body_end %}
  {% include "_javascripts.html" %}
{% endblock %}

{% extends "govuk/govuk_template.html" %}

{% block head %}
  {% include "_stylesheets.html" %}
{% endblock %}

{% block cookie_message %}
  {% include "_cookie_message.html" %}
{% endblock %}

{% block header_class %}with-proposition{% endblock %}

{% block proposition_header %}
  {% with items = [
      {"label": "Service status changes", "link": url_for('main.service_status_update_audits')}
  ] if current_user.is_authenticated() and (current_user.has_role('admin') or current_user.has_role('admin-ccs-category')) else [] %}
    {% include "toolkit/proposition-header.html" %}
  {% endwith %}
{% endblock %}

{% block content %}
  {% block breadcrumb %}{% endblock %}
  <div id="wrapper">
    <main id="content" role="main">
      {% block main_content %}{% endblock %}
    </main>
  </div>
{% endblock %}

{% block footer_top %}
  {% include "_footer_categories.html" %}
{% endblock %}

{% block body_end %}
  {% include "_javascripts.html" %}
{% endblock %}

Fix 502 response for 404 pages failing to render base template
Fix 502 response for 404 pages failing to render base template

FlaskLogin Anonymous users don't have `.has_role` method, and since
the _base_page templated is used by 404 pages we need to make sure
it can be rendered without a logged in user.

Checking for authenticated user before checking roles should fix the
issue.
