mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
refac
This commit is contained in:
parent
0c4a1ac54d
commit
8197844ff7
1 changed files with 38 additions and 33 deletions
|
|
@ -668,13 +668,18 @@ def get_sources_from_items(
|
||||||
collection_names.append(f"file-{item['id']}")
|
collection_names.append(f"file-{item['id']}")
|
||||||
|
|
||||||
elif item.get("type") == "collection":
|
elif item.get("type") == "collection":
|
||||||
|
# Manual Full Mode Toggle for Collection
|
||||||
|
knowledge_base = Knowledges.get_knowledge_by_id(item.get("id"))
|
||||||
|
|
||||||
|
if knowledge_base and (
|
||||||
|
user.role == "admin"
|
||||||
|
or knowledge_base.user_id == user.id
|
||||||
|
or has_access(user.id, "read", knowledge_base.access_control)
|
||||||
|
):
|
||||||
if (
|
if (
|
||||||
item.get("context") == "full"
|
item.get("context") == "full"
|
||||||
or request.app.state.config.BYPASS_EMBEDDING_AND_RETRIEVAL
|
or request.app.state.config.BYPASS_EMBEDDING_AND_RETRIEVAL
|
||||||
):
|
):
|
||||||
# Manual Full Mode Toggle for Collection
|
|
||||||
knowledge_base = Knowledges.get_knowledge_by_id(item.get("id"))
|
|
||||||
|
|
||||||
if knowledge_base and (
|
if knowledge_base and (
|
||||||
user.role == "admin"
|
user.role == "admin"
|
||||||
or knowledge_base.user_id == user.id
|
or knowledge_base.user_id == user.id
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue