Explorar o código

[slack] Add document access decorator

Harshg999 %!s(int64=4) %!d(string=hai) anos
pai
achega
25028148fa
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      desktop/core/src/desktop/lib/botserver/views.py

+ 3 - 1
desktop/core/src/desktop/lib/botserver/views.py

@@ -26,6 +26,8 @@ from desktop.lib.django_util import login_notrequired, JsonResponse
 from desktop.lib.exceptions_renderable import PopupException
 from desktop.models import Document2, _get_gist_document
 
+from notebook.decorators import check_document_access_permission
+
 from django.http import HttpResponse
 from django.utils.translation import ugettext as _
 from django.views.decorators.csrf import csrf_exempt
@@ -89,7 +91,7 @@ def handle_on_message(channel_id, bot_id, text, user_id):
       if not response['ok']:
         raise PopupException(_("Error posting message"), detail=response["error"])
 
-
+@check_document_access_permission
 def handle_on_link_shared(channel_id, message_ts, links):
   for item in links:
     path = urlsplit(item['url'])[2]