Hide ‘request to go live’ from API only users

Users who have the ‘manage API keys’ permission can see the settings
page. But they don’t have permission to request to go live.

At the moment they can still see the link, though clicking it gives them
a 403 error. This commit changes it so that they can’t see the link, and
tells them who they should speak to about going live (their manager).
This commit is contained in:
Chris Hill-Scott
2018-02-22 13:13:57 +00:00
parent 24f6b7246d
commit 103a36a5da
3 changed files with 72 additions and 12 deletions

View File

@@ -227,9 +227,14 @@
</ul>
<p>
To remove these restrictions
<a href="{{ url_for('.request_to_go_live', service_id=current_service.id) }}">request to go live</a>.
</p>
{% if current_user.has_permissions('manage_settings') %}
To remove these restrictions
<a href="{{ url_for('.request_to_go_live', service_id=current_service.id) }}">request to go live</a>.
{% else %}
Your service manager can ask to have these restrictions removed.
{% endif %}
</p>
{% else %}
<h2 class="heading-medium">Your service is live</h2>
@@ -328,7 +333,7 @@
<a href="{{ url_for('.service_switch_can_send_precompiled_letter', service_id=current_service.id) }}" class="button">
{{ 'Stop sending precompiled letters' if 'precompiled_letter' in current_service.permissions else 'Allow to send precompiled letters' }}
</a>
</li>
</li>
{% endif %}
<li class="bottom-gutter">
<a href="{{ url_for('.service_switch_email_auth', service_id=current_service.id) }}" class="button">