mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-28 03:12:04 -04:00
Add a button for switching 'upload_document' permission
Adds a platform admin button to the service settings to turn on/off 'upload_document' service permission. The permission allows uploading documents to document-download-api through the post notification API endpoint.
This commit is contained in:
@@ -319,6 +319,14 @@ def service_switch_can_send_precompiled_letter(service_id):
|
||||
return redirect(url_for('.service_settings', service_id=service_id))
|
||||
|
||||
|
||||
@main.route("/services/<service_id>/service-settings/can-upload-document")
|
||||
@login_required
|
||||
@user_is_platform_admin
|
||||
def service_switch_can_upload_document(service_id):
|
||||
switch_service_permissions(service_id, 'upload_document')
|
||||
return redirect(url_for('.service_settings', service_id=service_id))
|
||||
|
||||
|
||||
@main.route("/services/<service_id>/service-settings/archive", methods=['GET', 'POST'])
|
||||
@login_required
|
||||
@user_has_permissions('manage_service')
|
||||
|
||||
@@ -220,6 +220,7 @@ class HeaderNavigation(Navigation):
|
||||
'service_sms_senders',
|
||||
'service_switch_can_send_email',
|
||||
'service_switch_can_send_precompiled_letter',
|
||||
'service_switch_can_upload_document',
|
||||
'service_switch_can_send_sms',
|
||||
'service_switch_email_auth',
|
||||
'service_switch_live',
|
||||
@@ -430,6 +431,7 @@ class MainNavigation(Navigation):
|
||||
'service_delete_sms_sender',
|
||||
'service_switch_can_send_email',
|
||||
'service_switch_can_send_precompiled_letter',
|
||||
'service_switch_can_upload_document',
|
||||
'service_switch_can_send_sms',
|
||||
'service_switch_email_auth',
|
||||
'service_switch_live',
|
||||
@@ -628,6 +630,7 @@ class OrgNavigation(Navigation):
|
||||
'service_sms_senders',
|
||||
'service_switch_can_send_email',
|
||||
'service_switch_can_send_precompiled_letter',
|
||||
'service_switch_can_upload_document',
|
||||
'service_switch_can_send_sms',
|
||||
'service_switch_email_auth',
|
||||
'service_switch_live',
|
||||
|
||||
@@ -339,6 +339,11 @@
|
||||
{{ 'Stop user auth type editing' if 'email_auth' in current_service.permissions else 'Allow user auth type editing' }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="bottom-gutter">
|
||||
<a href="{{ url_for('.service_switch_can_upload_document', service_id=current_service.id) }}" class="button">
|
||||
{{ 'Stop uploading documents' if 'upload_document' in current_service.permissions else 'Allow to upload documents' }}
|
||||
</a>
|
||||
</li>
|
||||
{% if current_service.active %}
|
||||
<li class="bottom-gutter">
|
||||
<a href="{{ url_for('.archive_service', service_id=current_service.id) }}" class="button">
|
||||
|
||||
@@ -40,6 +40,11 @@ def get_service_settings_page(
|
||||
({'permissions': ['letter']},
|
||||
'.service_switch_can_send_precompiled_letter', {}, 'Allow to send precompiled letters'),
|
||||
|
||||
({'permissions': ['upload_document']},
|
||||
'.service_switch_can_upload_document', {}, 'Stop uploading documents'),
|
||||
({'permissions': []},
|
||||
'.service_switch_can_upload_document', {}, 'Allow to upload documents'),
|
||||
|
||||
({'permissions': ['sms']}, '.service_set_inbound_number', {'set_inbound_sms': True}, 'Allow inbound sms'),
|
||||
|
||||
({'active': True}, '.archive_service', {}, 'Archive service'),
|
||||
|
||||
Reference in New Issue
Block a user