[DE] Protect settings depend on permissions
This commit is contained in:
parent
8f1f89ee31
commit
0d54c6d31e
|
@ -124,6 +124,7 @@ define([
|
||||||
var me = this,
|
var me = this,
|
||||||
btn,
|
btn,
|
||||||
win = new DE.Views.ProtectDialog({
|
win = new DE.Views.ProtectDialog({
|
||||||
|
props: me.appConfig,
|
||||||
handler: function(result, value, props) {
|
handler: function(result, value, props) {
|
||||||
btn = result;
|
btn = result;
|
||||||
if (result == 'ok') {
|
if (result == 'ok') {
|
||||||
|
|
|
@ -61,10 +61,7 @@ define([
|
||||||
}, options);
|
}, options);
|
||||||
|
|
||||||
this.handler = options.handler;
|
this.handler = options.handler;
|
||||||
this.txtDescription = options.txtDescription || '';
|
|
||||||
this.props = options.props;
|
this.props = options.props;
|
||||||
this.isEdit = options.isEdit;
|
|
||||||
this.api = options.api;
|
|
||||||
|
|
||||||
this.template = options.template || [
|
this.template = options.template || [
|
||||||
'<div class="box">',
|
'<div class="box">',
|
||||||
|
@ -194,12 +191,9 @@ define([
|
||||||
|
|
||||||
_setDefaults: function (props) {
|
_setDefaults: function (props) {
|
||||||
if (props) {
|
if (props) {
|
||||||
var type = props.asc_getType();
|
this.rbReview.setDisabled(!props.canReview);
|
||||||
switch (type) {
|
this.rbForms.setDisabled(!props.canFillForms);
|
||||||
case Asc.c_oAscProtection.Forms: this.rbForms.setValue(true, true); break;
|
this.rbComments.setDisabled(!props.canComments);
|
||||||
case Asc.c_oAscProtection.Review: this.rbReview.setValue(true, true); break;
|
|
||||||
case Asc.c_oAscProtection.Comments: this.rbComments.setValue(true, true); break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue