Merge pull request #1168 from ONLYOFFICE/fix/bug-50962

Fix Bug 50962: add parameter to config: permissions->protect // show/…
This commit is contained in:
Julia Radzhabova 2021-09-10 10:51:23 +03:00 committed by GitHub
commit ea3357c6bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 7 deletions

View file

@ -55,7 +55,8 @@
view: ["Group1", ""] // current user can view comments made by users from Group1 and users without a group.
edit: ["Group1", ""] // current user can edit comments made by users from Group1 and users without a group.
remove: ["Group1", ""] // current user can remove comments made by users from Group1 and users without a group.
}
},
protect: <can protect document> // default = true. show/hide protect tab or protect buttons
}
},
editorConfig: {

View file

@ -1410,8 +1410,8 @@ define([
this.appOptions.trialMode = params.asc_getLicenseMode();
this.appOptions.isBeta = params.asc_getIsBeta();
this.appOptions.isSignatureSupport= this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport();
this.appOptions.isPasswordSupport = this.appOptions.isEdit && this.api.asc_isProtectionSupport();
this.appOptions.isSignatureSupport= this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport() && (this.permissions.protect!==false);
this.appOptions.isPasswordSupport = this.appOptions.isEdit && this.api.asc_isProtectionSupport() && (this.permissions.protect!==false);
this.appOptions.canProtect = (this.appOptions.isSignatureSupport || this.appOptions.isPasswordSupport);
this.appOptions.canEditContentControl = (this.permissions.modifyContentControl!==false);
this.appOptions.canHelp = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.help===false);

View file

@ -1111,8 +1111,8 @@ define([
this.appOptions.buildVersion = params.asc_getBuildVersion();
this.appOptions.trialMode = params.asc_getLicenseMode();
this.appOptions.isBeta = params.asc_getIsBeta();
this.appOptions.isSignatureSupport= this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport();
this.appOptions.isPasswordSupport = this.appOptions.isEdit && this.api.asc_isProtectionSupport();
this.appOptions.isSignatureSupport= this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport() && (this.permissions.protect!==false);
this.appOptions.isPasswordSupport = this.appOptions.isEdit && this.api.asc_isProtectionSupport() && (this.permissions.protect!==false);
this.appOptions.canProtect = (this.appOptions.isSignatureSupport || this.appOptions.isPasswordSupport);
this.appOptions.canHelp = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.help===false);
this.appOptions.isRestrictedEdit = !this.appOptions.isEdit && this.appOptions.canComments;

View file

@ -1241,8 +1241,10 @@ define([
if (this.permissions.editCommentAuthorOnly===undefined && this.permissions.deleteCommentAuthorOnly===undefined)
this.appOptions.canEditComments = this.appOptions.canDeleteComments = this.appOptions.isOffline;
}
this.appOptions.isSignatureSupport= this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport() && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge);
this.appOptions.isPasswordSupport = this.appOptions.isEdit && this.api.asc_isProtectionSupport() && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge);
this.appOptions.isSignatureSupport= this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport() && (this.permissions.protect!==false)
&& !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge);
this.appOptions.isPasswordSupport = this.appOptions.isEdit && this.api.asc_isProtectionSupport() && (this.permissions.protect!==false)
&& !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge);
this.appOptions.canProtect = (this.appOptions.isSignatureSupport || this.appOptions.isPasswordSupport);
this.appOptions.canHelp = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.help===false);
this.appOptions.isRestrictedEdit = !this.appOptions.isEdit && this.appOptions.canComments;