From 7f8b271e1b5501784d41fcaa50894e98855dddcb Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 1 Sep 2020 15:21:29 +0300 Subject: [PATCH] Deprecate permission.rename parameter (use onRequestRename event instead) --- apps/documenteditor/main/app/controller/Main.js | 4 +++- apps/presentationeditor/main/app/controller/Main.js | 5 ++++- apps/spreadsheeteditor/main/app/controller/Main.js | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index a73c98c45..000712bea 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1225,7 +1225,7 @@ define([ this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false); this.appOptions.canEditStyles = this.appOptions.canLicense && this.appOptions.canEdit; this.appOptions.canPrint = (this.permissions.print !== false); - this.appOptions.canRename = this.editorConfig.canRename && !!this.permissions.rename; + this.appOptions.canRename = this.editorConfig.canRename && (this.permissions.rename!==false); this.appOptions.buildVersion = params.asc_getBuildVersion(); this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && (typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave); this.appOptions.forcesave = this.appOptions.canForcesave; @@ -1286,6 +1286,8 @@ define([ if (this.permissions.changeHistory !== undefined) console.warn("Obsolete: The changeHistory parameter of the document permission section is deprecated. Please use onRequestRestore event instead."); + if (this.permissions.rename !== undefined) + console.warn("Obsolete: The rename parameter of the document permission section is deprecated. Please use onRequestRename event instead."); }, applyModeCommonElements: function() { diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 363e5bf26..1acd931cb 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -949,7 +949,7 @@ define([ this.appOptions.canViewComments = this.appOptions.canComments || !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false); this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false); this.appOptions.canPrint = (this.permissions.print !== false); - this.appOptions.canRename = this.editorConfig.canRename && !!this.permissions.rename; + this.appOptions.canRename = this.editorConfig.canRename && (this.permissions.rename!==false); this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && (typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave); this.appOptions.forcesave = this.appOptions.canForcesave; this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly); @@ -981,6 +981,9 @@ define([ this.api.asc_setViewMode(!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit); (this.appOptions.isRestrictedEdit && this.appOptions.canComments) && this.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyComments); this.api.asc_LoadDocument(); + + if (this.permissions.rename !== undefined) + console.warn("Obsolete: The rename parameter of the document permission section is deprecated. Please use onRequestRename event instead."); }, applyModeCommonElements: function() { diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index f7cfe5488..c76bcd2ef 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1011,7 +1011,7 @@ define([ this.appOptions.canComments = this.appOptions.canComments && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false); this.appOptions.canViewComments = this.appOptions.canComments || !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false); this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false); - this.appOptions.canRename = this.editorConfig.canRename && !!this.permissions.rename; + this.appOptions.canRename = this.editorConfig.canRename && (this.permissions.rename!==false); this.appOptions.trialMode = params.asc_getLicenseMode(); this.appOptions.canModifyFilter = (this.permissions.modifyFilter!==false); this.appOptions.canBranding = params.asc_getCustomization(); @@ -1019,6 +1019,8 @@ define([ this.headerView.setBranding(this.editorConfig.customization); this.appOptions.canRename && this.headerView.setCanRename(true); + if (this.permissions.rename !== undefined) + console.warn("Obsolete: The rename parameter of the document permission section is deprecated. Please use onRequestRename event instead."); } else this.appOptions.canModifyFilter = true;