mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-01 01:39:05 -05:00
refac
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user