1 parent e7fc581 commit 01d94d6Copy full SHA for 01d94d6
1 file changed
apps/oss/views/file.py
@@ -1,5 +1,5 @@
1
# coding=utf-8
2
-from application.models import Chat
+from application.models import Chat, Application
3
from maxkb.const import CONFIG
4
from common.auth import AllTokenAuth, TokenAuth
5
from common.auth.authentication import has_permissions
@@ -60,11 +60,6 @@ def post(self, request: Request):
60
if request.user is None or is_chat_path:
61
if source_type != FileSourceType.CHAT.value:
62
raise AppUnauthorizedFailed(403, _("No permission"))
63
- # 聊天文件必须归属于调用者所在应用下的会话
64
- if source_type == FileSourceType.CHAT.value:
65
- chat = QuerySet(Chat).filter(id=source_id, application_id=request.auth.application_id).first()
66
- if chat is None:
67
- raise AppUnauthorizedFailed(403, _("No permission"))
68
return result.success(
69
FileSerializer(
70
data={
0 commit comments