This commit is contained in:
Timothy Jaeryang Baek
2026-02-11 02:06:43 -06:00
parent 30f72672fa
commit 3e56261c5e
8 changed files with 115 additions and 209 deletions
+8 -8
View File
@@ -340,12 +340,12 @@ async def get_all_models(request, refresh: bool = False, user: UserModel = None)
def check_model_access(user, model, db=None):
if model.get("arena"):
meta = model.get("info", {}).get("meta", {})
access_grants = meta.get("access_grants", [])
if not has_access(
user.id,
type="read",
access_control=model.get("info", {})
.get("meta", {})
.get("access_control", {}),
permission="read",
access_grants=access_grants,
db=db,
):
raise Exception("Model not found")
@@ -384,12 +384,12 @@ def get_filtered_models(models, user, db=None):
}
for model in models:
if model.get("arena"):
meta = model.get("info", {}).get("meta", {})
access_grants = meta.get("access_grants", [])
if has_access(
user.id,
type="read",
access_control=model.get("info", {})
.get("meta", {})
.get("access_control", {}),
permission="read",
access_grants=access_grants,
user_group_ids=user_group_ids,
):
filtered_models.append(model)