mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
refactor location of proxy
This commit is contained in:
parent
baa5564f95
commit
ce58c53ff1
413 changed files with 2087 additions and 2088 deletions
22
litellm_proxy/management_endpoints/sso_helper_utils.py
Normal file
22
litellm_proxy/management_endpoints/sso_helper_utils.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
from litellm_proxy._types import LitellmUserRoles
|
||||
|
||||
|
||||
def check_is_admin_only_access(ui_access_mode: str) -> bool:
|
||||
"""Checks ui access mode is admin_only"""
|
||||
return ui_access_mode == "admin_only"
|
||||
|
||||
|
||||
def has_admin_ui_access(user_role: str) -> bool:
|
||||
"""
|
||||
Check if the user has admin access to the UI.
|
||||
|
||||
Returns:
|
||||
bool: True if user is 'proxy_admin' or 'proxy_admin_view_only', False otherwise.
|
||||
"""
|
||||
|
||||
if (
|
||||
user_role != LitellmUserRoles.PROXY_ADMIN.value
|
||||
and user_role != LitellmUserRoles.PROXY_ADMIN_VIEW_ONLY.value
|
||||
):
|
||||
return False
|
||||
return True
|
Loading…
Add table
Add a link
Reference in a new issue