mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-14 23:08:07 -04:00
so that platform admins (us) can view pages as regular users do easily. Simply adds a flag in the session cookie that overrides the actual platform admin flag on the user model if set. This way it's safe, since this only downgrades existing functionality, so if someone managed to alter it they could only get less permissions, not more. You can change this value from the user profile page if either: * you're a platform admin * the flag is set (to any value) on the cookie. This slightly weird check means that we don't check the underlying `user._platform_admin` flag anywhere in the code, even when toggling the suppression.
60 lines
1.9 KiB
HTML
60 lines
1.9 KiB
HTML
{% extends "withoutnav_template.html" %}
|
|
{% from "components/table.html" import list_table, row, field %}
|
|
{% from "components/table.html" import mapping_table, row, text_field, optional_text_field, edit_field, field, boolean_field with context %}
|
|
|
|
{% block per_page_title %}
|
|
Your profile
|
|
{% endblock %}
|
|
|
|
{% block maincolumn_content %}
|
|
|
|
<h1 class="heading-large">Your profile</h1>
|
|
|
|
<div class="body-copy-table">
|
|
{% call mapping_table(
|
|
caption='Your profile',
|
|
field_headings=['Label', 'Value', 'Action'],
|
|
field_headings_visible=False,
|
|
caption_visible=False
|
|
) %}
|
|
{% call row() %}
|
|
{{ text_field('Name') }}
|
|
{{ text_field(current_user.name) }}
|
|
{{ edit_field('Change', url_for('.user_profile_name')) }}
|
|
{% endcall %}
|
|
|
|
{% call row() %}
|
|
{{ text_field('Email address') }}
|
|
{{ text_field(current_user.email_address) }}
|
|
{% if can_see_edit %}
|
|
{{ edit_field('Change', url_for('.user_profile_email')) }}
|
|
{% else %}
|
|
{{ text_field('') }}
|
|
{% endif %}
|
|
{% endcall %}
|
|
|
|
{% call row() %}
|
|
{{ text_field('Mobile number') }}
|
|
{{ optional_text_field(current_user.mobile_number) }}
|
|
{{ edit_field('Change', url_for('.user_profile_mobile_number')) }}
|
|
{% endcall %}
|
|
|
|
{% call row() %}
|
|
{{ text_field('Password') }}
|
|
{{ text_field('Last changed ' + current_user.password_changed_at|format_delta) }}
|
|
{{ edit_field('Change', url_for('.user_profile_password')) }}
|
|
{% endcall %}
|
|
|
|
{% if current_user.platform_admin or session.get('suppress_platform_admin') %}
|
|
{% call row() %}
|
|
{{ text_field('Suppress Platform Admin') }}
|
|
{{ text_field('On' if session.get('suppress_platform_admin') else 'Off') }}
|
|
{{ edit_field('Change', url_for('.user_profile_suppress_platform_admin')) }}
|
|
{% endcall %}
|
|
{% endif %}
|
|
|
|
{% endcall %}
|
|
</div>
|
|
|
|
{% endblock %}
|