"backend/apps/vscode:/vscode.git/clone" did not exist on "bdd153d8f5d91487f8c7eca77c340c62b1073626"
Unverified Commit 1871a7a2 authored by Timothy Jaeryang Baek's avatar Timothy Jaeryang Baek Committed by GitHub
Browse files

Merge pull request #4354 from cheahjs/fix/admin-shared-chat-when-disabled

fix: admins shared chats with ENABLE_ADMIN_CHAT_ACCESS set to false
parents 1bf042ac 73954f4a
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment