[DE] Protect settings depend on permissions

This commit is contained in:
Julia Radzhabova 2022-09-27 11:34:47 +03:00
parent 8f1f89ee31
commit 0d54c6d31e
2 changed files with 4 additions and 9 deletions

View file

@ -124,6 +124,7 @@ define([
var me = this,
btn,
win = new DE.Views.ProtectDialog({
props: me.appConfig,
handler: function(result, value, props) {
btn = result;
if (result == 'ok') {

View file

@ -61,10 +61,7 @@ define([
}, options);
this.handler = options.handler;
this.txtDescription = options.txtDescription || '';
this.props = options.props;
this.isEdit = options.isEdit;
this.api = options.api;
this.template = options.template || [
'<div class="box">',
@ -194,12 +191,9 @@ define([
_setDefaults: function (props) {
if (props) {
var type = props.asc_getType();
switch (type) {
case Asc.c_oAscProtection.Forms: this.rbForms.setValue(true, true); break;
case Asc.c_oAscProtection.Review: this.rbReview.setValue(true, true); break;
case Asc.c_oAscProtection.Comments: this.rbComments.setValue(true, true); break;
}
this.rbReview.setDisabled(!props.canReview);
this.rbForms.setDisabled(!props.canFillForms);
this.rbComments.setDisabled(!props.canComments);
}
},