Skip to content

Commit 74bc60c

Browse files
committed
fix(mothership): enforce ownership check on workflow resource attachments
1 parent 80eb5b9 commit 74bc60c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

apps/sim/lib/copilot/chat/process-contents.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -701,18 +701,18 @@ export async function resolveActiveResourceContext(
701701
resourceType: string,
702702
resourceId: string,
703703
workspaceId: string,
704-
_userId: string,
704+
userId: string,
705705
chatId?: string
706706
): Promise<AgentContext | null> {
707707
try {
708708
switch (resourceType) {
709709
case 'workflow': {
710710
const ctx = await processWorkflowFromDb(
711711
resourceId,
712-
undefined,
712+
userId,
713713
'@active_resource',
714714
'current_workflow',
715-
undefined,
715+
workspaceId,
716716
chatId
717717
)
718718
if (!ctx) return null

0 commit comments

Comments
 (0)