mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Let users without send_messages view broadcasts
At the moment viewing a broadcast is limited to those users who have the `send_messages` permission. This doesn’t match how we describe the permissions on the team members page This commit makes it so that any team member can see a broadcast that’s in any state other than `draft`.
This commit is contained in:
@@ -182,7 +182,7 @@ def preview_broadcast_message(service_id, broadcast_message_id):
|
||||
|
||||
|
||||
@main.route('/services/<uuid:service_id>/broadcast/<uuid:broadcast_message_id>')
|
||||
@user_has_permissions('send_messages')
|
||||
@user_has_permissions()
|
||||
@service_has_permission('broadcast')
|
||||
def view_broadcast_message(service_id, broadcast_message_id):
|
||||
broadcast_message = BroadcastMessage.from_id(
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
) }}
|
||||
|
||||
{% if broadcast_message.status == 'pending-approval' %}
|
||||
{% if broadcast_message.created_by == current_user %}
|
||||
{% if broadcast_message.created_by == current_user and current_user.has_permissions('send_messages') %}
|
||||
<div class="banner govuk-!-margin-bottom-6">
|
||||
<h2 class="govuk-heading-s govuk-!-margin-bottom-3">Your broadcast is waiting for approval from another member of your team</h2>
|
||||
<p class="govuk-body">Once approved it will be live until
|
||||
@@ -29,7 +29,7 @@
|
||||
delete_link_text='Withdraw this broadcast'
|
||||
) }}
|
||||
</div>
|
||||
{% else %}
|
||||
{% elif current_user.has_permissions('send_messages') %}
|
||||
{% call form_wrapper(class="banner govuk-!-margin-bottom-6") %}
|
||||
<p class="govuk-body govuk-!-margin-top-0 govuk-!-margin-bottom-3">
|
||||
{{ broadcast_message.created_by.name }} wants to broadcast this
|
||||
@@ -41,6 +41,13 @@
|
||||
delete_link_text='Reject this broadcast'
|
||||
) }}
|
||||
{% endcall %}
|
||||
{% else %}
|
||||
<div class="banner govuk-!-margin-bottom-6">
|
||||
<h2 class="govuk-heading-s govuk-!-margin-bottom-3">This broadcast is waiting for approval</h2>
|
||||
<p class="govuk-body">
|
||||
You don’t have permission to approve broadcasts.
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<p class="govuk-body govuk-!-margin-bottom-3">
|
||||
|
||||
Reference in New Issue
Block a user