LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows
Python ai-agentsdata-engineeringdocument-aigenerative-aiidpjson-extractionllmmcp-serverocrpdf-extractionprompt-engineeringstructured-output
UN-2891 [FEAT] Enable organization-level sharing for API deployments (#1631)
Rahul Johny7db8766938e0
diff --git a/backend/api_v2/api_deployment_views.py b/backend/api_v2/api_deployment_views.pyindex 4767cb1a6..dc4d77108 100644--- a/backend/api_v2/api_deployment_views.py+++ b/backend/api_v2/api_deployment_views.py@@ -6,7 +6,7 @@ from typing import Anyfrom configuration.models import Configurationfrom django.db.models import QuerySetfrom django.http import HttpResponse-from permissions.permission import IsOwner, IsOwnerOrSharedUser+from permissions.permission import IsOwner, IsOwnerOrSharedUserOrSharedToOrgfrom prompt_studio.prompt_studio_registry_v2.models import PromptStudioRegistryfrom rest_framework import serializers, status, views, viewsetsfrom rest_framework.decorators import action@@ -198,7 +198,7 @@ class APIDeploymentViewSet(viewsets.ModelViewSet):def get_permissions(self) -> list[Any]:if self.action in ["destroy", "partial_update", "update"]:return [IsOwner()]- return [IsOwnerOrSharedUser()]+ return [IsOwnerOrSharedUserOrSharedToOrg()]def get_queryset(self) -> QuerySet | None:queryset = APIDeployment.objects.for_user(self.request.user)diff --git a/backend/api_v2/models.py b/backend/api_v2/models.pyindex addc1d980..437015c7f 100644--- a/backend/api_v2/models.py+++ b/backend/api_v2/models.py@@ -29,12 +29,14 @@ class APIDeploymentModelManager(DefaultOrganizationManagerMixin, models.Manager)"""Filter API deployments that the user can access:- API deployments created by the user- API deployments shared with the user+ - API deployments shared with the entire organization"""from django.db.models import Qreturn self.filter(Q(created_by=user) # Owned by user| Q(shared_users=user) # Shared with user+ | Q(shared_to_org=True) # Shared to entire organization).distinct()diff --git a/frontend/src/components/deployments/api-deployment/ApiDeployment.jsx b/frontend/src/components/deployments/api-deployment/ApiDeployment.jsxindex 99235ddca..f580a46e7 100644--- a/frontend/src/components/deployments/api-deployment/ApiDeployment.jsx+++ b/frontend/src/components/deployments/api-deployment/ApiDeployment.jsx@@ -567,7 +567,7 @@ function ApiDeployment() {loading={isLoadingShare}allUsers={allUsers}onApply={onShare}- isSharableToOrg={false}+ isSharableToOrg={true}/></>);