fix: admin chat share issue

This commit is contained in:
Timothy Jaeryang Baek 2025-06-28 14:02:07 +04:00
parent f123d70cff
commit ffd7b004f4

View file

@ -684,8 +684,10 @@ async def archive_chat_by_id(id: str, user=Depends(get_verified_user)):
@router.post("/{id}/share", response_model=Optional[ChatResponse]) @router.post("/{id}/share", response_model=Optional[ChatResponse])
async def share_chat_by_id(request: Request, id: str, user=Depends(get_verified_user)): async def share_chat_by_id(request: Request, id: str, user=Depends(get_verified_user)):
if not has_permission( if (user.role != "admin") and (
not has_permission(
user.id, "chat.share", request.app.state.config.USER_PERMISSIONS user.id, "chat.share", request.app.state.config.USER_PERMISSIONS
)
): ):
raise HTTPException( raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED, status_code=status.HTTP_401_UNAUTHORIZED,