From ddd360160ad89535c148ad230c6130d6bb1a6f61 Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Wed, 16 Oct 2024 16:30:20 +0300 Subject: [PATCH] [bug] Send needpassword for pdf form; For bug 70979 --- DocService/sources/canvasservice.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/DocService/sources/canvasservice.js b/DocService/sources/canvasservice.js index 8783f80c..3665b026 100644 --- a/DocService/sources/canvasservice.js +++ b/DocService/sources/canvasservice.js @@ -247,9 +247,16 @@ async function getOutputData(ctx, cmd, outputData, key, optConn, optAdditionalOu userPassword = await utils.decryptPassword(ctx, encryptedUserPassword); isCorrectPassword = decryptedPassword === userPassword; } - if(password && !isCorrectPassword && !formatChecker.isBrowserEditorFormat(originFormat)) { + let isNeedPassword = password && !isCorrectPassword; + if (isNeedPassword && formatChecker.isBrowserEditorFormat(originFormat)) { + //check pdf form + //todo check without storage + let formEditor = await storage.listObjects(ctx, key + '/Editor.bin'); + isNeedPassword = 0 !== formEditor.length; + } + if (isNeedPassword) { ctx.logger.debug("getOutputData password mismatch"); - if(encryptedUserPassword) { + if (encryptedUserPassword) { outputData.setStatus('needpassword'); outputData.setData(constants.CONVERT_PASSWORD); } else {