mirror of
https://github.com/open-webui/open-webui
synced 2025-02-01 15:24:25 +00:00
fix: #9003
This commit is contained in:
parent
be665f2a3e
commit
a8f2919e9e
@ -184,10 +184,10 @@ async def delete_model_by_id(id: str, user=Depends(get_verified_user)):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
user.role == "admin"
|
user.role != "admin"
|
||||||
or model.user_id == user.id
|
or model.user_id != user.id
|
||||||
or has_access(user.id, "write", model.access_control)
|
or not has_access(user.id, "write", model.access_control)
|
||||||
):
|
):
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||||
detail=ERROR_MESSAGES.UNAUTHORIZED,
|
detail=ERROR_MESSAGES.UNAUTHORIZED,
|
||||||
|
Loading…
Reference in New Issue
Block a user