mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-05 02:41:34 +00:00
fix: keep a cloned chat in a shared folder the user can write to (#31370)
This commit is contained in:
parent
c7caa1421d
commit
d4d04dca0d
1 changed files with 3 additions and 1 deletions
|
|
@ -660,11 +660,13 @@ class ChatTable:
|
|||
db: AsyncSession | None = None,
|
||||
) -> list[ChatModel]:
|
||||
async with get_async_db_context(db) as session:
|
||||
from open_webui.utils.access_control.folders import has_folder_write_access
|
||||
|
||||
# Validate folder_id references — clear any that don't exist
|
||||
folder_ids = {f.folder_id for f in chat_import_forms if f.folder_id}
|
||||
existing = set()
|
||||
for fid in folder_ids:
|
||||
if await Folders.get_folder_by_id_and_user_id(fid, user_id, db=session):
|
||||
if await has_folder_write_access(user_id, fid, db=session):
|
||||
existing.add(fid)
|
||||
|
||||
cleared = 0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue