[DE] Fix restrictions
This commit is contained in:
parent
0f1a07cb94
commit
66259ebf51
|
@ -218,15 +218,12 @@ define([
|
||||||
|
|
||||||
applyRestrictions: function(type) {
|
applyRestrictions: function(type) {
|
||||||
if (type === Asc.c_oAscEDocProtect.ReadOnly) {
|
if (type === Asc.c_oAscEDocProtect.ReadOnly) {
|
||||||
this.api.asc_setViewMode(true);
|
this.api.asc_setRestriction(Asc.c_oAscRestrictionType.View);
|
||||||
} else if (type === Asc.c_oAscEDocProtect.Comments) {
|
} else if (type === Asc.c_oAscEDocProtect.Comments) {
|
||||||
this.appConfig.canComments && this.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyComments);
|
this.api.asc_setRestriction(this.appConfig.canComments ? Asc.c_oAscRestrictionType.OnlyComments : Asc.c_oAscRestrictionType.View);
|
||||||
this.api.asc_setViewMode(!this.appConfig.canComments || !this.appConfig.isEdit && !this.appConfig.isRestrictedEdit);
|
|
||||||
} else if (type === Asc.c_oAscEDocProtect.Forms) {
|
} else if (type === Asc.c_oAscEDocProtect.Forms) {
|
||||||
this.appConfig.canFillForms && this.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyForms);
|
this.api.asc_setRestriction(this.appConfig.canFillForms ? Asc.c_oAscRestrictionType.OnlyForms : Asc.c_oAscRestrictionType.View);
|
||||||
this.api.asc_setViewMode(!this.appConfig.canFillForms || !this.appConfig.isEdit && !this.appConfig.isRestrictedEdit);
|
|
||||||
} else { // none or tracked changes
|
} else { // none or tracked changes
|
||||||
this.api.asc_setViewMode(!this.appConfig.isEdit && !this.appConfig.isRestrictedEdit);
|
|
||||||
if (this.appConfig.isRestrictedEdit) {
|
if (this.appConfig.isRestrictedEdit) {
|
||||||
this.appConfig.canComments && this.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyComments);
|
this.appConfig.canComments && this.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyComments);
|
||||||
this.appConfig.canFillForms && this.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyForms);
|
this.appConfig.canFillForms && this.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyForms);
|
||||||
|
|
Loading…
Reference in a new issue