Fix Bug 36122.

This commit is contained in:
Julia Radzhabova 2017-10-23 15:19:07 +03:00
parent 39343d71f9
commit 4b83f6a2fd
4 changed files with 24 additions and 9 deletions

View file

@ -334,9 +334,6 @@
var type = /^(?:(pdf|djvu|xps))$/.exec(_config.document.fileType);
if (type && typeof type[1] === 'string') {
if (!_config.document.permissions)
_config.document.permissions = {};
_config.document.permissions.edit = _config.document.permissions.review = false;
_config.editorConfig.canUseHistory = false;
}

View file

@ -90,14 +90,20 @@ var ApplicationController = new(function(){
if (docConfig) {
permissions = $.extend(permissions, docConfig.permissions);
var docInfo = new Asc.asc_CDocInfo();
var _permissions = $.extend({}, docConfig.permissions),
docInfo = new Asc.asc_CDocInfo();
docInfo.put_Id(docConfig.key);
docInfo.put_Url(docConfig.url);
docInfo.put_Title(docConfig.title);
docInfo.put_Format(docConfig.fileType);
docInfo.put_VKey(docConfig.vkey);
docInfo.put_Token(docConfig.token);
docInfo.put_Permissions(permissions);
docInfo.put_Permissions(_permissions);
var type = /^(?:(pdf|djvu|xps))$/.exec(docConfig.fileType);
if (type && typeof type[1] === 'string') {
permissions.edit = permissions.review = false;
}
if (api) {
api.asc_registerCallback('asc_onGetEditorPermissions', onEditorPermissions);

View file

@ -305,7 +305,8 @@ define([
if (data.doc) {
this.permissions = $.extend(this.permissions, data.doc.permissions);
var _user = new Asc.asc_CUserInfo();
var _permissions = $.extend({}, data.doc.permissions),
_user = new Asc.asc_CUserInfo();
_user.put_Id(this.appOptions.user.id);
_user.put_FullName(this.appOptions.user.fullname);
@ -319,9 +320,14 @@ define([
docInfo.put_UserInfo(_user);
docInfo.put_CallbackUrl(this.editorConfig.callbackUrl);
docInfo.put_Token(data.doc.token);
docInfo.put_Permissions(this.permissions);
docInfo.put_Permissions(_permissions);
// docInfo.put_Review(this.permissions.review);
// docInfo.put_OfflineApp(this.editorConfig.nativeApp === true); // used in sdk for testing
var type = /^(?:(pdf|djvu|xps))$/.exec(data.doc.fileType);
if (type && typeof type[1] === 'string') {
this.permissions.edit = this.permissions.review = false;
}
}
this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this));

View file

@ -213,7 +213,8 @@ define([
if (data.doc) {
this.permissions = $.extend(this.permissions, data.doc.permissions);
var _user = new Asc.asc_CUserInfo();
var _permissions = $.extend({}, data.doc.permissions),
_user = new Asc.asc_CUserInfo();
_user.put_Id(this.appOptions.user.id);
_user.put_FullName(this.appOptions.user.fullname);
@ -227,7 +228,12 @@ define([
docInfo.put_UserInfo(_user);
docInfo.put_CallbackUrl(this.editorConfig.callbackUrl);
docInfo.put_Token(data.doc.token);
docInfo.put_Permissions(this.permissions);
docInfo.put_Permissions(_permissions);
var type = /^(?:(pdf|djvu|xps))$/.exec(data.doc.fileType);
if (type && typeof type[1] === 'string') {
this.permissions.edit = this.permissions.review = false;
}
}
this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this));