Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/server/src/controllers/chatflows/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ const updateChatflow = async (req: Request, res: Response, next: NextFunction) =
`Error: chatflowsController.saveChatflow - workspace ${workspaceId} not found!`
)
}
const chatflow = await chatflowsService.getChatflowById(req.params.id, workspaceId)
// Admins can update chatflows across their org regardless of active workspace
const isAdmin = req.user?.roles?.includes('Admin') || req.user?.permissions?.includes('org:manage')
const chatflow = await chatflowsService.getChatflowById(req.params.id, isAdmin ? undefined : workspaceId)
if (!chatflow) {
return res.status(404).send(`Chatflow ${req.params.id} not found`)
}
Expand Down
Loading