Remove check for send_messages permission from broadcast pages

The `send_messages` permission has been deprecated for use with
broadcast services, so we can drop support for it in the code. We
were supporting both the old permissions and new permissions
(`create_broadcasts` and `approve_broadcasts`) while we switched people
over.

This removes `send_messages` from the `user_has_permissions` decorator
around the broadcast routes and from the page to view a broadcast and
broadcast dashboards. We can now git rid of a lot of the parameterization
that was temporarily added to the tests.
This commit is contained in:
Katie Smith
2021-07-22 17:12:01 +01:00
parent b5fa6aeb33
commit 8b08661902
6 changed files with 116 additions and 172 deletions

View File

@@ -19,9 +19,9 @@
{% block service_page_title %}
{% if broadcast_message.status == 'pending-approval' %}
{% if broadcast_message.created_by and broadcast_message.created_by == current_user
and current_user.has_permissions('send_messages', 'create_broadcasts', 'approve_broadcasts', restrict_admin_usage=True) %}
and current_user.has_permissions('create_broadcasts', 'approve_broadcasts', restrict_admin_usage=True) %}
{{ broadcast_message.template.name }} is waiting for approval
{% elif current_user.has_permissions('send_messages', 'approve_broadcasts', restrict_admin_usage=True) %}
{% elif current_user.has_permissions('approve_broadcasts', restrict_admin_usage=True) %}
{% if broadcast_message.created_by %}
{{ broadcast_message.created_by.name }}
{% else %}
@@ -43,7 +43,7 @@
{% if broadcast_message.status == 'pending-approval' %}
{% if broadcast_message.created_by and broadcast_message.created_by == current_user
and current_user.has_permissions('send_messages', 'create_broadcasts', 'approve_broadcasts', restrict_admin_usage=True) %}
and current_user.has_permissions('create_broadcasts', 'approve_broadcasts', restrict_admin_usage=True) %}
<div class="banner govuk-!-margin-bottom-6">
<h1 class="govuk-heading-m govuk-!-margin-bottom-3">
{{ broadcast_message.template.name }} is waiting for approval
@@ -56,7 +56,7 @@
delete_link=url_for('main.reject_broadcast_message', service_id=current_service.id, broadcast_message_id=broadcast_message.id),
delete_link_text='Discard this alert'
) }}
{% elif current_user.has_permissions('send_messages', 'approve_broadcasts', restrict_admin_usage=True) %}
{% elif current_user.has_permissions('approve_broadcasts', restrict_admin_usage=True) %}
<p class="govuk-body govuk-!-margin-bottom-3">
When you use a live account youll need another member of
your team to approve your alert.
@@ -93,7 +93,7 @@
) }}
{% endif %}
</div>
{% elif current_user.has_permissions('send_messages', 'approve_broadcasts', restrict_admin_usage=True) %}
{% elif current_user.has_permissions('approve_broadcasts', restrict_admin_usage=True) %}
{% call form_wrapper(class="banner govuk-!-margin-bottom-6") %}
<h1 class="govuk-heading-m govuk-!-margin-top-0 govuk-!-margin-bottom-3">
{% if broadcast_message.created_by %}