Depricate changeHistory and rename parameters of permissions. Use events instead.

This commit is contained in:
Julia Radzhabova 2020-09-11 11:26:19 +03:00
parent 35a8e81973
commit ca5413af89
5 changed files with 4 additions and 17 deletions

View file

@ -43,8 +43,6 @@
reader: <can view in readable mode>,
review: <can review>, // default = edit
print: <can print>, // default = true
rename: <can rename>, // default = false
changeHistory: <can change history>, // default = false // must be deprecated, check onRequestRestore event instead
comment: <can comment in view mode> // default = edit,
modifyFilter: <can add, remove and save filter in the spreadsheet> // default = true
modifyContentControl: <can modify content controls in documenteditor> // default = true

View file

@ -1217,7 +1217,7 @@ define([
this.appOptions.canViewReview = true;
this.appOptions.canUseHistory = this.appOptions.canLicense && this.editorConfig.canUseHistory && this.appOptions.canCoAuthoring && !this.appOptions.isOffline;
this.appOptions.canHistoryClose = this.editorConfig.canHistoryClose;
this.appOptions.canHistoryRestore= this.editorConfig.canHistoryRestore && (this.permissions.changeHistory !== false);
this.appOptions.canHistoryRestore= this.editorConfig.canHistoryRestore;
this.appOptions.canUseMailMerge= this.appOptions.canLicense && this.appOptions.canEdit && !this.appOptions.isOffline;
this.appOptions.canSendEmailAddresses = this.appOptions.canLicense && this.editorConfig.canSendEmailAddresses && this.appOptions.canEdit && this.appOptions.canCoAuthoring;
this.appOptions.canComments = this.appOptions.canLicense && (this.permissions.comment===undefined ? this.appOptions.isEdit : this.permissions.comment) && (this.editorConfig.mode !== 'view');
@ -1226,7 +1226,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!==false);
this.appOptions.canRename = this.editorConfig.canRename;
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;
@ -1288,11 +1288,6 @@ define([
this.appOptions.isRestrictedEdit && this.appOptions.canComments && this.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyComments);
this.appOptions.isRestrictedEdit && this.appOptions.canFillForms && this.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyForms);
this.api.asc_LoadDocument();
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() {

View file

@ -950,7 +950,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!==false);
this.appOptions.canRename = this.editorConfig.canRename;
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);
@ -986,9 +986,6 @@ 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() {

View file

@ -1013,7 +1013,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!==false);
this.appOptions.canRename = this.editorConfig.canRename;
this.appOptions.trialMode = params.asc_getLicenseMode();
this.appOptions.canModifyFilter = (this.permissions.modifyFilter!==false);
this.appOptions.canBranding = params.asc_getCustomization();
@ -1024,8 +1024,6 @@ define([
this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object');
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions);
this.headerView.setUserName(Common.Utils.UserInfoParser.getParsedName(this.appOptions.user.fullname));
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;

View file

@ -739,7 +739,6 @@ define([
me.appOptions.canViewComments = me.appOptions.canComments || !((typeof (me.editorConfig.customization) == 'object') && me.editorConfig.customization.comments===false);
me.appOptions.canEditComments = me.appOptions.isOffline || !(typeof (me.editorConfig.customization) == 'object' && me.editorConfig.customization.commentAuthorOnly);
me.appOptions.canChat = me.appOptions.canLicense && !me.appOptions.isOffline && !((typeof (me.editorConfig.customization) == 'object') && me.editorConfig.customization.chat===false);
me.appOptions.canRename = !!me.permissions.rename;
me.appOptions.canBranding = params.asc_getCustomization();
me.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof me.editorConfig.customization == 'object');