mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
refac: files rbac
This commit is contained in:
@@ -98,6 +98,13 @@ class FilesTable:
|
||||
|
||||
return [FileModel.model_validate(file) for file in db.query(File).all()]
|
||||
|
||||
def get_files_by_user_id(self, user_id: str) -> list[FileModel]:
|
||||
with get_db() as db:
|
||||
return [
|
||||
FileModel.model_validate(file)
|
||||
for file in db.query(File).filter_by(user_id=user_id).all()
|
||||
]
|
||||
|
||||
def delete_file_by_id(self, id: str) -> bool:
|
||||
|
||||
with get_db() as db:
|
||||
|
||||
Reference in New Issue
Block a user