litellm/litellm/models/object_permission.py
moe-berri 05ffde5988
feat(proxy): app-scoped read access to Customer Management through object permissions (#52781)
* feat(proxy): let non-admins read customer apps granted through object_permission.apps

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(proxy): cover app grants on app and customer usage reads

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* feat(proxy): only proxy admins can change app grants

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* feat(ui): show granted apps read-only in Customer Management for non-admins

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* feat(ui): let proxy admins grant a team access to customer management apps

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): close app grant bypasses and scope member reads to the app

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* chore(ui): regenerate api types

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* refactor(ui): split the grantee apps page out of AppsManager

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): drop a redundant isinstance on the new user app grant check

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): let proxy admins grant apps in bulk user creation and never write stored app grants back for non-admins

Non-admin object permission edits no longer include apps in the upsert record, so a stale read cannot restore a revoked grant. The sidebar hides admin-only Customer Management pages from admin viewers.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* feat(ui): move app access grants to an Internal Access page in Customer Management

The team form no longer carries the apps picker. A proxy admin picks a team on the new page and chooses the applications its members can view.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* style(ui): format the Internal Access page

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* feat(ui): grant apps to users and organizations from Internal Access

Internal Access now picks a team, a user or an organization. A failed save shows an error next to the button.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): authenticate app reads before opening the app store

The app router authenticates at the router level again, so an unauthenticated read is rejected before a database transaction opens.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-19 10:43:41 -08:00

29 lines
975 B
Python

"""
Object permission table model.
Canonical definition for ``litellm_objectpermissiontable``. Re-exported from
``litellm.proxy._types`` for backwards compatibility.
"""
from collections.abc import Sequence
from litellm.types.llms.base import LiteLLMPydanticObjectBase
class LiteLLM_ObjectPermissionTable(LiteLLMPydanticObjectBase):
"""Represents a LiteLLM_ObjectPermissionTable record"""
object_permission_id: str
mcp_servers: list[str] | None = []
mcp_access_groups: list[str] | None = []
mcp_tool_permissions: dict[str, list[str]] | None = None
vector_stores: list[str] | None = []
agents: list[str] | None = []
agent_access_groups: list[str] | None = []
models: list[str] | None = []
mcp_toolsets: list[str] | None = None
blocked_tools: list[str] | None = []
search_tools: list[str] | None = []
mcp_tool_search_enabled: bool | None = None
skills: list[str] | None = None
apps: Sequence[str] | None = None