Skip to content

Commit

Permalink
[wopi] Increase checkExtendedPDF download limit; Fix permissions for …
Browse files Browse the repository at this point in the history
…formsubmit action; For bug 67135
  • Loading branch information
konovalovsergey committed Apr 2, 2024
1 parent 5b85537 commit d510780
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions apps/api/wopi/editor-wopi.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ div {
var fileType = fileInfo.BaseFileName ? fileInfo.BaseFileName.substr(fileInfo.BaseFileName.lastIndexOf('.') + 1) : "";
fileType = fileInfo.FileExtension ? fileInfo.FileExtension.substr(1) : fileType;
fileType = fileType.toLowerCase();
let permissionsEdit = !fileInfo.ReadOnly && fileInfo.UserCanWrite && queryParams.formsubmit !== "1";
let permissionsFillForm = permissionsEdit || queryParams.formsubmit === "1";
var config = {
"width": "100%",
"height": "100%",
Expand All @@ -300,10 +302,11 @@ div {
"folder": fileInfo.BreadcrumbFolderName
},
"permissions": {
"edit": !fileInfo.ReadOnly && fileInfo.UserCanWrite,
"edit": permissionsEdit,
"review": (fileInfo.SupportsReviewing===false) ? false : (fileInfo.UserCanReview===false ? false : fileInfo.UserCanReview),
"copy": fileInfo.CopyPasteRestrictions!=="CurrentDocumentOnly" && fileInfo.CopyPasteRestrictions!=="BlockAll",
"print": !fileInfo.DisablePrint && !fileInfo.HidePrintOption
"print": !fileInfo.DisablePrint && !fileInfo.HidePrintOption,
"fillForms": permissionsFillForm
},
"options": {
"WOPISrc": userAuth.wopiSrc
Expand Down
3 changes: 2 additions & 1 deletion apps/common/checkExtendedPDF.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
*
*/
function checkExtendedPDF(directUrl, key, url, token, callback) {
var limit = 110;
//110 is not enough for the new PDF form
var limit = 300;
if (directUrl) {
downloadPartialy(directUrl, limit, null, function(text) {
callback(isExtendedPDFFile(text))
Expand Down

0 comments on commit d510780

Please sign in to comment.