Commit 84c67364 authored by Alexander.Trofimov's avatar Alexander.Trofimov

add asc_getRights and Asc.c_oRights (from server config). Used to set singletone mode

parent afd4249b
......@@ -39,6 +39,7 @@ AscCommon.baseEditorsApi.prototype._onEndPermissions = function()
var oResult = new AscCommon.asc_CAscEditorPermissions();
oResult.setLicenseType(Asc.c_oLicenseResult.Success);
oResult.setCanBranding(true);
oResult.setRights(Asc.c_oRights.Edit);
this.sendEvent('asc_onGetEditorPermissions', oResult);
}
};
\ No newline at end of file
......@@ -40,7 +40,8 @@ AscCommon.baseEditorsApi.prototype._onEndPermissions = function () {
oResult.setLicenseType(type);
oResult.setCanBranding(Asc.c_oLicenseResult.Error !== type); // Для тех, у кого есть лицензия, branding доступен
oResult.setIsLight(this.licenseResult['light']);
oResult.setIsTrial(this.licenseResult['trial']);
oResult.setTrial(this.licenseResult['trial']);
oResult.setRights(this.licenseResult['rights']);
}
this.sendEvent('asc_onGetEditorPermissions', oResult);
}
......
......@@ -111,6 +111,14 @@
ExpiredTrial: 6
};
var c_oRights = {
None : 0,
Edit : 1,
Review : 2,
Comment : 3,
View : 4
};
/**
* Класс asc_CAscEditorPermissions для прав редакторов
* -----------------------------------------------------------------------------
......@@ -122,6 +130,8 @@
this.licenseType = c_oLicenseResult.Error;
this.isLight = false;
this.trial = false;
this.rights = c_oRights.None;
this.canCoAuthoring = true;
this.canReaderMode = true;
this.canBranding = false;
......@@ -158,6 +168,9 @@
asc_CAscEditorPermissions.prototype.asc_getTrial = function () {
return this.trial;
};
asc_CAscEditorPermissions.prototype.asc_getRights = function () {
return this.rights;
};
asc_CAscEditorPermissions.prototype.setLicenseType = function (v) {
this.licenseType = v;
......@@ -168,9 +181,12 @@
asc_CAscEditorPermissions.prototype.setIsLight = function (v) {
this.isLight = v;
};
asc_CAscEditorPermissions.prototype.setIsTrial = function (v) {
asc_CAscEditorPermissions.prototype.setTrial = function (v) {
this.trial = v;
};
asc_CAscEditorPermissions.prototype.setRights = function (v) {
this.rights = v;
};
/** @constructor */
function asc_ValAxisSettings() {
......@@ -2683,6 +2699,14 @@
prot['Connections'] = prot.Connections;
prot['ExpiredTrial'] = prot.ExpiredTrial;
window['Asc']['c_oRights'] = window['Asc'].c_oRights = c_oRights;
prot = c_oRights;
prot['None'] = prot.None;
prot['Edit'] = prot.Edit;
prot['Review'] = prot.Review;
prot['Comment'] = prot.Comment;
prot['View'] = prot.View;
window["AscCommon"].asc_CAscEditorPermissions = asc_CAscEditorPermissions;
prot = asc_CAscEditorPermissions.prototype;
prot["asc_getLicenseType"] = prot.asc_getLicenseType;
......@@ -2694,6 +2718,7 @@
prot["asc_getIsAnalyticsEnable"] = prot.asc_getIsAnalyticsEnable;
prot["asc_getIsLight"] = prot.asc_getIsLight;
prot["asc_getTrial"] = prot.asc_getTrial;
prot["asc_getRights"] = prot.asc_getRights;
window["AscCommon"].asc_ValAxisSettings = asc_ValAxisSettings;
prot = asc_ValAxisSettings.prototype;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment