Bug 53757: move chat to permisions. deprecate customization.chat parameter.

This commit is contained in:
Julia Radzhabova 2021-11-19 22:41:44 +03:00
parent e1b7a107ca
commit abb96ec866
6 changed files with 18 additions and 6 deletions

View file

@ -1403,7 +1403,11 @@ define([
this.appOptions.canComments = this.appOptions.canLicense && (this.permissions.comment===undefined ? this.appOptions.isEdit : this.permissions.comment) && (this.editorConfig.mode !== 'view');
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.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !(this.permissions.chat===false || (this.permissions.chat===undefined) &&
(typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false);
if ((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat!==undefined) {
console.log("Obsolete: The 'chat' parameter of the 'customization' section is deprecated. Please use 'chat' parameter in the permissions instead.");
}
this.appOptions.canEditStyles = this.appOptions.canLicense && this.appOptions.canEdit;
this.appOptions.canPrint = (this.permissions.print !== false);
this.appOptions.canRename = this.editorConfig.canRename;

View file

@ -114,7 +114,7 @@ export class storeAppOptions {
this.canViewComments = this.canComments || !((typeof (this.customization) == 'object') && this.customization.comments===false);
this.canEditComments = this.isOffline || !(typeof (this.customization) == 'object' && this.customization.commentAuthorOnly);
this.canDeleteComments= this.isOffline || !permissions.deleteCommentAuthorOnly;
this.canChat = this.canLicense && !this.isOffline && !((typeof (this.customization) == 'object') && this.customization.chat === false);
this.canChat = this.canLicense && !this.isOffline && (permissions.chat !== false);
this.canEditStyles = this.canLicense && this.canEdit;
this.canPrint = (permissions.print !== false);
this.fileKey = document.key;

View file

@ -1103,7 +1103,11 @@ define([
this.appOptions.canComments = this.appOptions.canLicense && (this.permissions.comment===undefined ? this.appOptions.isEdit : this.permissions.comment) && (this.editorConfig.mode !== 'view');
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.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !(this.permissions.chat===false || (this.permissions.chat===undefined) &&
(typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false);
if ((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat!==undefined) {
console.log("Obsolete: The 'chat' parameter of the 'customization' section is deprecated. Please use 'chat' parameter in the permissions instead.");
}
this.appOptions.canPrint = (this.permissions.print !== 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);

View file

@ -92,7 +92,7 @@ export class storeAppOptions {
this.canViewComments = this.canComments || !((typeof (this.customization) == 'object') && this.customization.comments===false);
this.canEditComments = this.isOffline || !(typeof (this.customization) == 'object' && this.customization.commentAuthorOnly);
this.canDeleteComments= this.isOffline || !permissions.deleteCommentAuthorOnly;
this.canChat = this.canLicense && !this.isOffline && !((typeof (this.customization) == 'object') && this.customization.chat === false);
this.canChat = this.canLicense && !this.isOffline && (permissions.chat !== false);
this.canEditStyles = this.canLicense && this.canEdit;
this.canPrint = (permissions.print !== false);
this.isRestrictedEdit = !this.isEdit && this.canComments;

View file

@ -1197,7 +1197,11 @@ define([
this.appOptions.canComments = this.appOptions.canLicense && (this.permissions.comment===undefined ? (this.permissions.edit !== false) : this.permissions.comment) && (this.editorConfig.mode !== 'view');
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.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !(this.permissions.chat===false || (this.permissions.chat===undefined) &&
(typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false);
if ((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat!==undefined) {
console.log("Obsolete: The 'chat' parameter of the 'customization' section is deprecated. Please use 'chat' parameter in the permissions instead.");
}
this.appOptions.canRename = this.editorConfig.canRename;
this.appOptions.buildVersion = params.asc_getBuildVersion();
this.appOptions.trialMode = params.asc_getLicenseMode();

View file

@ -92,7 +92,7 @@ export class storeAppOptions {
this.canViewComments = this.canComments || !((typeof (this.customization) == 'object') && this.customization.comments===false);
this.canEditComments = this.isOffline || !(typeof (this.customization) == 'object' && this.customization.commentAuthorOnly);
this.canDeleteComments= this.isOffline || !permissions.deleteCommentAuthorOnly;
this.canChat = this.canLicense && !this.isOffline && !((typeof (this.customization) == 'object') && this.customization.chat === false);
this.canChat = this.canLicense && !this.isOffline && (permissions.chat !== false);
this.canPrint = (permissions.print !== false);
this.isRestrictedEdit = !this.isEdit && this.canComments;
this.trialMode = params.asc_getLicenseMode();