mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
fix: #9003
This commit is contained in:
parent
be665f2a3e
commit
a8f2919e9e
1 changed files with 4 additions and 4 deletions
|
|
@ -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 a new issue