-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Permissions for Conversations #1545
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Reviewed everything up to 49c87ee in 1 minute and 54 seconds
More details
- Looked at
357
lines of code in4
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. py/core/providers/logger/r2r_logger.py:267
- Draft comment:
Ensure thatuser_ids
are consistently treated asTEXT
in the database queries to avoid type mismatches. - Reason this comment was not posted:
Comment did not seem useful.
2. py/core/main/services/management_service.py:677
-
Draft comment:
This function is a duplicate of an existing function inr2r_logger.py
. Consider using the existing function directly instead of creating a new wrapper. -
Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment claims duplication, but I cannot verify this without seeing the other file. The function is newly added in this diff, so the comment is about a change. However, without strong evidence of duplication, the comment may not be useful. The comment could be speculative if the duplication is not confirmed.
I might be missing the context from the other file, which could confirm the duplication. Without seeing the other file, I cannot be certain if the comment is correct.
Given the rules, I should only keep comments with strong evidence of correctness. Without access to the other file, I cannot confirm the duplication claim.
Delete the comment due to lack of strong evidence confirming the duplication claim.
Workflow ID: wflow_Qk6GyBj4HIt4dAUY
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
@@ -832,6 +868,8 @@ | |||
message: str = Body(..., description="New content"), | |||
auth_user=Depends(self.service.providers.auth.auth_wrapper), | |||
) -> dict: | |||
# TODO: Add a check to see if the user has access to the message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a check to verify if the user has access to edit the message. This is crucial for maintaining security and preventing unauthorized edits.
# TODO: Add a check to see if the user has access to the message | |
if not await self.service.verify_message_access(message_id, auth_user.id): raise R2RException("You do not have access to edit this message.", 403) |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on 5874be4 in 15 seconds
More details
- Looked at
13
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. py/core/main/api/management_router.py:788
- Draft comment:
The change fromuser_ids = auth_user.id
touser_ids = [auth_user.id]
is correct. Theconversations_overview
function expects a list of user IDs, not a single ID. - Reason this comment was not posted:
Confidence changes required:0%
The change fromuser_ids = auth_user.id
touser_ids = [auth_user.id]
is correct because theconversations_overview
function expects a list of user IDs, not a single ID.
Workflow ID: wflow_g3SdFT6RUDxcWplL
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Important
Implement permission checks for conversation operations, restricting non-superusers from accessing or modifying conversations they do not own, and update database schema to include user ownership.
management_router.py
for conversation-related endpoints, restricting non-superusers from accessing or modifying conversations they do not own.conversations
table inr2r_logger.py
to includeuser_id
andname
columns.verify_conversation_access()
inr2r_logger.py
to check user access to conversations.verify_conversation_access()
inmanagement_service.py
to delegate access checks to the logging provider.create_conversation()
,get_conversation()
,add_message()
, andedit_message()
inmanagement_service.py
to include user ID in operations.This description was created by for 5874be4. It will automatically update as commits are pushed.