Replies: 2 comments 5 replies
-
|
Alternatively: Don't spy on your users. |
Beta Was this translation helpful? Give feedback.
-
|
This appears to me to be a general oversight/bug to me as many of the other RCAThe admin role check was added to a few endpoints starting in early 2024 (when the admin panel user chat viewing feature was added), but the Immediate FixAdd an admin role check to the get_chat_by_id endpoint to match the pattern used in other endpoints: @router.get("/{id}", response_model=Optional[ChatResponse])
async def get_chat_by_id(id: str, user=Depends(get_verified_user)):
if user.role == "admin" and ENABLE_ADMIN_CHAT_ACCESS:
chat = Chats.get_chat_by_id(id)
else:
chat = Chats.get_chat_by_id_and_user_id(id, user.id)
# ... rest of functionShould probably also update the admin panel to use this endpoint and possibly adjust the share endpoint to be more internally consistent. Broader IssueAdmin support is really inconsistent across the This might be a good time to review the admin support across the API for consistency, or even take a step back and reevaluate the permissions model for the API entirely. Workaround@Mara-Li - Regarding accessing all user chats as an admin. There's appears to be a workaround through the Happy to submit an issue and/or PR to fix the immediate issue or help with a broader consistency review if the maintainers would like. |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
In an instance shared between multiple user, the admin can't get the content of a specific conversation using an endpoint, resulting to a
401response.But; the admin can get all conversation using the endpoint
GET api/v1/chats/all/db.It leads to inconsistancies, as the admin could read all conversation if the environment key for that is set to
true.Solution: The admin should be able to pull a conversation.
Getting the conversation with the
dbis pretty long, so it can't be used in production.Beta Was this translation helpful? Give feedback.
All reactions