Merge pull request #1803 from alphagov/upload-document-service-permission

Add a service permission for uploading documents to Document Download
This commit is contained in:
Alexey Bezhan
2018-03-27 10:21:47 +01:00
committed by GitHub
2 changed files with 26 additions and 0 deletions

View File

@@ -238,6 +238,7 @@ SCHEDULE_NOTIFICATIONS = 'schedule_notifications'
EMAIL_AUTH = 'email_auth'
LETTERS_AS_PDF = 'letters_as_pdf'
PRECOMPILED_LETTER = 'precompiled_letter'
UPLOAD_DOCUMENT = 'upload_document'
SERVICE_PERMISSION_TYPES = [
EMAIL_TYPE,
@@ -249,6 +250,7 @@ SERVICE_PERMISSION_TYPES = [
EMAIL_AUTH,
LETTERS_AS_PDF,
PRECOMPILED_LETTER,
UPLOAD_DOCUMENT,
]

View File

@@ -0,0 +1,24 @@
"""empty message
Revision ID: 0182_add_upload_document_perm
Revises: 0181_billing_primary_key
Create Date: 2018-03-23 16:20:00
"""
# revision identifiers, used by Alembic.
revision = '0182_add_upload_document_perm'
down_revision = '0181_billing_primary_key'
from alembic import op
def upgrade():
op.get_bind()
op.execute("insert into service_permission_types values('upload_document')")
def downgrade():
op.get_bind()
op.execute("delete from service_permissions where permission = 'upload_document'")
op.execute("delete from service_permission_types where name = 'upload_document'")