def remove_document_permissions(apps, schema_editor):
    """Reverse the above additions of permissions."""
    ContentType = apps.get_model('contenttypes.ContentType')
    Permission = apps.get_model('auth.Permission')
    document_content_type = ContentType.objects.get(model='document',
        app_label='wagtaildocs')
    Permission.objects.filter(content_type=document_content_type,
        codename__in=('add_document', 'change_document', 'delete_document')
        ).delete()
