mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-13 04:45:19 +00:00
fix: admins viewing shared chats with ENABLE_ADMIN_CHAT_ACCESS set to false
This commit is contained in:
parent
1bf042ac84
commit
73954f4a63
1 changed files with 1 additions and 1 deletions
|
|
@ -186,7 +186,7 @@ async def get_shared_chat_by_id(share_id: str, user=Depends(get_verified_user)):
|
|||
status_code=status.HTTP_401_UNAUTHORIZED, detail=ERROR_MESSAGES.NOT_FOUND
|
||||
)
|
||||
|
||||
if user.role == "user":
|
||||
if user.role == "user" or (user.role == "admin" and not ENABLE_ADMIN_CHAT_ACCESS):
|
||||
chat = Chats.get_chat_by_share_id(share_id)
|
||||
elif user.role == "admin" and ENABLE_ADMIN_CHAT_ACCESS:
|
||||
chat = Chats.get_chat_by_id(share_id)
|
||||
|
|
|
|||
Loading…
Reference in a new issue