This commit is contained in:
Timothy Jaeryang Baek
2026-03-01 13:54:44 -06:00
parent 259d5ca596
commit 93bab8d822
3 changed files with 14 additions and 12 deletions

View File

@@ -32,6 +32,10 @@ def has_access_to_file(
if not file:
return False
# Direct ownership
if file.user_id == user.id:
return True
# Check if the file is associated with any knowledge bases the user has access to
knowledge_bases = Knowledges.get_knowledges_by_file_id(file_id, db=db)
user_group_ids = {