Skip to content

Commit 9c4ec59

Browse files
johnyrahulclaude
andcommitted
UN-2868 [FIX] Restrict connector configuration to workflow owners only
Extended ownership restrictions to source and destination connectors: - Disabled connector type dropdown for non-owners - Disabled Configure button for non-owners - Added helpful tooltip messages explaining ownership requirements - Passed isWorkflowOwner prop through WorkflowCard to DsSettingsCard This ensures that only workflow owners can modify source and destination connector configurations in shared workflows. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent b0d15a1 commit 9c4ec59

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

frontend/src/components/agency/agency/Agency.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,7 @@ function Agency() {
11191119
connType={sourceTypes.connectors[0]}
11201120
endpointDetails={source}
11211121
message={sourceMsg}
1122+
isWorkflowOwner={isWorkflowOwner()}
11221123
/>
11231124
</Col>
11241125

@@ -1137,6 +1138,7 @@ function Agency() {
11371138
connType={sourceTypes.connectors[1]}
11381139
endpointDetails={destination}
11391140
message={destinationMsg}
1141+
isWorkflowOwner={isWorkflowOwner()}
11401142
/>
11411143
</Col>
11421144
<Col span={12}>

frontend/src/components/agency/ds-settings-card/DsSettingsCard.jsx

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ import { ConfigureConnectorModal } from "../configure-connector-modal/ConfigureC
2121
import { useExceptionHandler } from "../../../hooks/useExceptionHandler";
2222
import "./DsSettingsCard.css";
2323

24-
function DsSettingsCard({ connType, endpointDetails, message }) {
24+
function DsSettingsCard({
25+
connType,
26+
endpointDetails,
27+
message,
28+
isWorkflowOwner,
29+
}) {
2530
const workflowStore = useWorkflowStore();
2631
const { source, destination, allowChangeEndpoint, details } = workflowStore;
2732
const [options, setOptions] = useState([]);
@@ -231,16 +236,19 @@ function DsSettingsCard({ connType, endpointDetails, message }) {
231236
<Space>
232237
<Tooltip
233238
title={
234-
!allowChangeEndpoint &&
235-
"Workflow used in API/Task/ETL deployment"
239+
!allowChangeEndpoint
240+
? "Workflow used in API/Task/ETL deployment"
241+
: !isWorkflowOwner
242+
? "Only workflow owner can modify connectors"
243+
: ""
236244
}
237245
>
238246
<Select
239247
className="ds-set-card-select"
240248
options={options}
241249
placeholder="Select Connector Type"
242250
value={endpointDetails?.connection_type || undefined}
243-
disabled={!allowChangeEndpoint}
251+
disabled={!allowChangeEndpoint || !isWorkflowOwner}
244252
onChange={(value) => {
245253
handleEndpointUpdate({
246254
connection_type: value,
@@ -251,14 +259,21 @@ function DsSettingsCard({ connType, endpointDetails, message }) {
251259
/>
252260
</Tooltip>
253261

254-
<Tooltip title={getConfigureTooltipMessage()}>
262+
<Tooltip
263+
title={
264+
!isWorkflowOwner
265+
? "Only workflow owner can configure connectors"
266+
: getConfigureTooltipMessage()
267+
}
268+
>
255269
<Button
256270
type="primary"
257271
onClick={() => setOpenModal(true)}
258272
disabled={
259273
!endpointDetails?.connection_type ||
260274
connMode === "API" ||
261-
connMode === "APPDEPLOYMENT"
275+
connMode === "APPDEPLOYMENT" ||
276+
!isWorkflowOwner
262277
}
263278
>
264279
Configure
@@ -310,6 +325,7 @@ DsSettingsCard.propTypes = {
310325
connType: PropTypes.string.isRequired,
311326
endpointDetails: PropTypes.object.isRequired,
312327
message: PropTypes.string,
328+
isWorkflowOwner: PropTypes.bool,
313329
};
314330

315331
export { DsSettingsCard };

frontend/src/components/agency/workflow-card/WorkflowCard.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ function WorkflowCard({
7373
message,
7474
customContent,
7575
connectorIcon,
76+
isWorkflowOwner,
7677
}) {
7778
const isCompleted = isCompletedStatus(number);
7879
const isConnectorType = isConnectorTypeStatus(number);
@@ -100,6 +101,7 @@ function WorkflowCard({
100101
connType={connType}
101102
endpointDetails={endpointDetails}
102103
message={message}
104+
isWorkflowOwner={isWorkflowOwner}
103105
/>
104106
)}
105107
</div>
@@ -118,6 +120,7 @@ WorkflowCard.propTypes = {
118120
message: PropTypes.string,
119121
customContent: PropTypes.node,
120122
connectorIcon: PropTypes.string,
123+
isWorkflowOwner: PropTypes.bool,
121124
};
122125

123126
export { WorkflowCard };

0 commit comments

Comments
 (0)