mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-02 02:12:25 +00:00
fix: save a file edit made through write access to a shared knowledge base (#30448)
This commit is contained in:
parent
5f8d8f0c5e
commit
a046e07044
1 changed files with 4 additions and 4 deletions
|
|
@ -1936,10 +1936,10 @@ async def process_file(
|
|||
The session is committed before external API calls, and updates use a fresh session.
|
||||
"""
|
||||
config = await get_retrieval_config()
|
||||
if user.role == 'admin':
|
||||
file = await Files.get_file_by_id(form_data.file_id, db=db)
|
||||
else:
|
||||
file = await Files.get_file_by_id_and_user_id(form_data.file_id, user.id, db=db)
|
||||
file = await Files.get_file_by_id(form_data.file_id, db=db)
|
||||
if file and file.user_id != user.id and user.role != 'admin':
|
||||
if not await has_access_to_file(file.id, 'write', user, db=db):
|
||||
file = None
|
||||
|
||||
if file:
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue