mirror of
https://github.com/open-webui/open-webui
synced 2025-05-20 21:25:21 +00:00
fix: admin folder deletion issue
This commit is contained in:
parent
9036945361
commit
0644abe402
@ -236,7 +236,8 @@ async def delete_folder_by_id(
|
|||||||
chat_delete_permission = has_permission(
|
chat_delete_permission = has_permission(
|
||||||
user.id, "chat.delete", request.app.state.config.USER_PERMISSIONS
|
user.id, "chat.delete", request.app.state.config.USER_PERMISSIONS
|
||||||
)
|
)
|
||||||
if not chat_delete_permission:
|
|
||||||
|
if user.role != "admin" and not chat_delete_permission:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status.HTTP_403_FORBIDDEN,
|
status_code=status.HTTP_403_FORBIDDEN,
|
||||||
detail=ERROR_MESSAGES.ACCESS_PROHIBITED,
|
detail=ERROR_MESSAGES.ACCESS_PROHIBITED,
|
||||||
|
Loading…
Reference in New Issue
Block a user