mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
can_team_access_model
This commit is contained in:
parent
eeee61db65
commit
b6d6e270b4
1 changed files with 7 additions and 2 deletions
|
@ -33,6 +33,7 @@ from litellm.proxy._types import (
|
||||||
ScopeMapping,
|
ScopeMapping,
|
||||||
Span,
|
Span,
|
||||||
)
|
)
|
||||||
|
from litellm.proxy.auth.auth_checks import can_team_access_model
|
||||||
from litellm.proxy.utils import PrismaClient, ProxyLogging
|
from litellm.proxy.utils import PrismaClient, ProxyLogging
|
||||||
|
|
||||||
from .auth_checks import (
|
from .auth_checks import (
|
||||||
|
@ -723,8 +724,12 @@ class JWTAuthManager:
|
||||||
team_models = team_object.models
|
team_models = team_object.models
|
||||||
if isinstance(team_models, list) and (
|
if isinstance(team_models, list) and (
|
||||||
not requested_model
|
not requested_model
|
||||||
or requested_model in team_models
|
or can_team_access_model(
|
||||||
or "*" in team_models
|
model=requested_model,
|
||||||
|
team_object=team_object,
|
||||||
|
llm_router=None,
|
||||||
|
team_model_aliases=None,
|
||||||
|
)
|
||||||
):
|
):
|
||||||
is_allowed = allowed_routes_check(
|
is_allowed = allowed_routes_check(
|
||||||
user_role=LitellmUserRoles.TEAM,
|
user_role=LitellmUserRoles.TEAM,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue