From 49bbb8c2efe3f85ee7c7e77332341fbbee9c41d2 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 23 Dec 2022 16:59:39 +0300 Subject: [PATCH] [DE] Fix protection: enable all protect options regardless of permissions; enable filling forms in edit mode; set track changes protection regardless of review permissions --- apps/common/main/lib/controller/ReviewChanges.js | 7 ++++--- apps/documenteditor/main/app/controller/Main.js | 2 +- apps/documenteditor/main/app/view/ProtectDialog.js | 3 --- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/apps/common/main/lib/controller/ReviewChanges.js b/apps/common/main/lib/controller/ReviewChanges.js index 52ebd79c91..283a73b920 100644 --- a/apps/common/main/lib/controller/ReviewChanges.js +++ b/apps/common/main/lib/controller/ReviewChanges.js @@ -1053,12 +1053,13 @@ define([ Common.Utils.lockControls(Common.enumLock.docLockReview, props.isReviewOnly, {array: [this.dlgChanges.btnAccept, this.dlgChanges.btnReject]}); Common.Utils.lockControls(Common.enumLock.docLockComments, props.isCommentsOnly, {array: [this.dlgChanges.btnAccept, this.dlgChanges.btnReject]}); } - if (this.appConfig.canReview) { + if (!this.appConfig.isReviewOnly) { + // protection in document is more important than permissions.review, call asc_SetLocalTrackRevisions even if canReview is false if (props.isReviewOnly) { - this.onTurnPreview(true); + this.api.asc_SetLocalTrackRevisions(true); this.onApiShowChange(); } else if (this._state.prevReviewProtected) { - this.onTurnPreview(false); + this.api.asc_SetLocalTrackRevisions(false); this.onApiShowChange(); } this._state.prevReviewProtected = props.isReviewOnly; diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 2ce4257c9e..3153b264eb 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1547,7 +1547,7 @@ define([ this.appOptions.canEditContentControl = (this.permissions.modifyContentControl!==false); this.appOptions.canHelp = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.help===false); this.appOptions.canSubmitForms = false; // this.appOptions.canLicense && (typeof (this.editorConfig.customization) == 'object') && !!this.editorConfig.customization.submitForm; - this.appOptions.canFillForms = this.appOptions.canLicense && ((this.permissions.fillForms===undefined) ? this.appOptions.isEdit : this.permissions.fillForms) && (this.editorConfig.mode !== 'view'); + this.appOptions.canFillForms = this.appOptions.canLicense && (this.appOptions.isEdit ? true : this.permissions.fillForms) && (this.editorConfig.mode !== 'view'); this.appOptions.isRestrictedEdit = !this.appOptions.isEdit && (this.appOptions.canComments || this.appOptions.canFillForms); if (this.appOptions.isRestrictedEdit && this.appOptions.canComments && this.appOptions.canFillForms) // must be one restricted mode, priority for filling forms this.appOptions.canComments = false; diff --git a/apps/documenteditor/main/app/view/ProtectDialog.js b/apps/documenteditor/main/app/view/ProtectDialog.js index f314063acf..5f2de5c204 100644 --- a/apps/documenteditor/main/app/view/ProtectDialog.js +++ b/apps/documenteditor/main/app/view/ProtectDialog.js @@ -201,9 +201,6 @@ define([ _setDefaults: function (props) { if (props) { - this.rbReview.setDisabled(!props.canReview); - this.rbForms.setDisabled(!props.canFillForms); - this.rbComments.setDisabled(!props.canComments); } },