-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Extend (fix) definition of public docs in KG Views #4950
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
PR Summary
Extended public document access in Knowledge Graph views to include documents from connector credential pairs with access_type='PUBLIC'
, fixing an oversight from previous migration (3b25685ff73c).
- Modified
user_owned_and_public_docs
CTE inbackend/onyx/db/kg_temp_view.py
to check both document-level (d.is_public
) and connector-level (ccp.access_type='PUBLIC'
) public access - Verified functionality using GitHub docs and explicit email ownership removal tests
- Change aligns with migration history that moved from
is_public
toaccess_type
for access control
1 file reviewed, 1 comment
Edit PR Review Bot Settings | Greptile
@@ -61,7 +61,7 @@ def create_views( | |||
INNER JOIN kg_used_docs kud ON kud.kg_used_doc_id = d.id | |||
WHERE ccp.status != 'DELETING' | |||
AND ccp.access_type != 'SYNC' | |||
AND u.email = :user_email | |||
AND (u.email = :user_email or ccp.access_type::text = 'PUBLIC') |
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.
style: consider using access_type = 'PUBLIC'
instead of access_type::text = 'PUBLIC'
since access_type is already a text field according to migration 61ff3651add4
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.
damn impressive greptile
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.
+1
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 gud
@@ -61,7 +61,7 @@ def create_views( | |||
INNER JOIN kg_used_docs kud ON kud.kg_used_doc_id = d.id | |||
WHERE ccp.status != 'DELETING' | |||
AND ccp.access_type != 'SYNC' | |||
AND u.email = :user_email | |||
AND (u.email = :user_email or ccp.access_type::text = 'PUBLIC') |
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.
damn impressive greptile
Description
We covered only 1/2 of the cases how a document can be public. We also need to allow docs with connector_credential_pair.access_type = "PUBLIC"
Linear: https://linear.app/danswer/issue/DAN-2140/bug-definition-of-public-docs-incomplete-in-kg-views
How Has This Been Tested?
Locally, using Github docs. Also explicitly removed email ownership (for test purposes) to make sure that the docs are allowed because of the connector_credential_pair.access_type = "PUBLIC" condition.
Backporting (check the box to trigger backport action)
Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.