Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

UN-2890 [FEAT] Enable organization-level sharing for pipelines (ETL and TASK) (#1633)

Rahul Johny457fb88441d5
diff --git a/backend/pipeline_v2/models.py b/backend/pipeline_v2/models.py
index 27ad84641..cdd85405f 100644
--- a/backend/pipeline_v2/models.py
+++ b/backend/pipeline_v2/models.py
@@ -23,11 +23,12 @@ class PipelineModelManager(DefaultOrganizationManagerMixin, models.Manager):
"""Filter pipelines that the user can access:
- Pipelines created by the user
- Pipelines shared with the user
+ - Pipelines shared with the entire organization
"""
return self.filter(
Q(created_by=user) # Owned by user
| Q(shared_users=user) # Shared with user
- # Q(shared_to_org=True) # Org-wide sharing (optional)
+ | Q(shared_to_org=True) # Shared to entire organization
).distinct()
diff --git a/backend/pipeline_v2/views.py b/backend/pipeline_v2/views.py
index b7a1cce17..396729f39 100644
--- a/backend/pipeline_v2/views.py
+++ b/backend/pipeline_v2/views.py
@@ -9,7 +9,7 @@ from api_v2.postman_collection.dto import PostmanCollection
from django.db import IntegrityError
from django.db.models import QuerySet
from django.http import HttpResponse
-from permissions.permission import IsOwner, IsOwnerOrSharedUser
+from permissions.permission import IsOwner, IsOwnerOrSharedUserOrSharedToOrg
from rest_framework import serializers, status, viewsets
from rest_framework.decorators import action
from rest_framework.request import Request
@@ -52,7 +52,7 @@ class PipelineViewSet(viewsets.ModelViewSet):
def get_permissions(self) -> list[Any]:
if self.action in ["destroy", "partial_update", "update"]:
return [IsOwner()]
- return [IsOwnerOrSharedUser()]
+ return [IsOwnerOrSharedUserOrSharedToOrg()]
serializer_class = PipelineSerializer
diff --git a/frontend/src/components/pipelines-or-deployments/pipelines/Pipelines.jsx b/frontend/src/components/pipelines-or-deployments/pipelines/Pipelines.jsx
index 0233c4a96..0a105862d 100644
--- a/frontend/src/components/pipelines-or-deployments/pipelines/Pipelines.jsx
+++ b/frontend/src/components/pipelines-or-deployments/pipelines/Pipelines.jsx
@@ -759,7 +759,7 @@ function Pipelines({ type }) {
loading={isLoadingShare}
allUsers={Array.isArray(allUsers) ? allUsers : []}
onApply={onShare}
- isSharableToOrg={false}
+ isSharableToOrg={true}
/>
)}
</div>