Fix Agent bot 2 permission bugs (#818) (#16909)

This commit is contained in:
Wang Qi
2026-07-14 20:11:16 +08:00
committed by GitHub
parent 760203be42
commit 3087eb854c
5 changed files with 37 additions and 52 deletions

View File

@@ -35,7 +35,7 @@ from api.utils.file_response import (
import jwt
from quart import Response, jsonify, request, make_response
from api.apps import current_user, login_required
from api.apps import AUTH_JWT, AUTH_API, AUTH_BETA, current_user, login_required
from api.apps.services.canvas_replica_service import CanvasReplicaService
from api.db import CanvasCategory
from api.db.db_models import Task
@@ -2514,7 +2514,7 @@ async def preview_attachment(tenant_id=None, attachment_id=None):
@manager.route("/agents/attachments/<attachment_id>/download", methods=["GET"]) # noqa: F821
@login_required
@login_required(auth_types=[AUTH_JWT, AUTH_API, AUTH_BETA])
@add_tenant_id_to_kwargs
async def download_attachment(tenant_id=None, attachment_id=None):
"""Stream an agent-generated attachment as a download."""