From 86d23138b203cc1ba05205610c16790d684084f6 Mon Sep 17 00:00:00 2001 From: GMayank0310 <166708007+GMayank0310@users.noreply.github.com> Date: Tue, 22 Oct 2024 14:20:52 +0530 Subject: [PATCH] Fix agent viewer access for leave bot (#1579) * fixed user name issue in the audit log for leave bot api * fixed user name issue in the audit log for leave bot api --- kairon/api/app/routers/user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kairon/api/app/routers/user.py b/kairon/api/app/routers/user.py index d9c0f2726..38bbcf0a1 100644 --- a/kairon/api/app/routers/user.py +++ b/kairon/api/app/routers/user.py @@ -1,7 +1,7 @@ from fastapi import APIRouter, Path, Security from starlette.requests import Request -from kairon.shared.constants import ADMIN_ACCESS, TESTER_ACCESS, OWNER_ACCESS +from kairon.shared.constants import ADMIN_ACCESS, TESTER_ACCESS, OWNER_ACCESS, AGENT_ACCESS from kairon.shared.data.constant import ACCESS_ROLES, ACTIVITY_STATUS from kairon.shared.multilingual.utils.translator import Translator from kairon.shared.utils import Utility, MailUtility @@ -244,7 +244,7 @@ async def get_model_testing_logs_accuracy( async def leave_bot( background_tasks: BackgroundTasks, bot: str = Path(description="bot id", examples=["613f63e87a1d435607c3c183"]), - current_user: User = Security(Authentication.get_current_user_and_bot, scopes=TESTER_ACCESS) + current_user: User = Security(Authentication.get_current_user_and_bot, scopes=AGENT_ACCESS) ): """ Allows a user except owner to leave a bot.