Fix admin model access (#17)

* Update models.py

* Update models.py

* Update models.py

* Update ollama.py

* Update openai.py

* Update models.py

* Update openai.py

* Update ollama.py
This commit is contained in:
Classic298
2025-08-11 23:23:44 +02:00
committed by GitHub
parent 62506b1955
commit d8c4dd6f79
2 changed files with 58 additions and 40 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ async def get_model_by_id(id: str, user=Depends(get_verified_user)):
model = Models.get_model_by_id(id)
if model:
if (
user.role == "admin"
(user.role == "admin" and ENABLE_ADMIN_WORKSPACE_CONTENT_ACCESS)
or model.user_id == user.id
or has_access(user.id, "read", model.access_control)
):