Change review permissions: deprecate customization.reviewPermissions parameter. Use permissions.reviewGroup instead: list of groups, that current user can accept/reject.
This commit is contained in:
parent
310c00b245
commit
f17b8d1c76
|
@ -49,7 +49,8 @@
|
||||||
fillForms: <can edit forms in view mode> // default = edit || review,
|
fillForms: <can edit forms in view mode> // default = edit || review,
|
||||||
copy: <can copy data> // default = true,
|
copy: <can copy data> // default = true,
|
||||||
editCommentAuthorOnly: <can edit your own comments only> // default = false
|
editCommentAuthorOnly: <can edit your own comments only> // default = false
|
||||||
deleteCommentAuthorOnly: <can delete your own comments only> // default = false
|
deleteCommentAuthorOnly: <can delete your own comments only> // default = false,
|
||||||
|
reviewGroup: ["Group1", ""] // current user can accept/reject review changes made by users from Group1 and users without a group. [] - use groups, but can't change any group's changes
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
editorConfig: {
|
editorConfig: {
|
||||||
|
|
|
@ -972,7 +972,8 @@ Common.Utils.UserInfoParser = new(function() {
|
||||||
separator = String.fromCharCode(160),
|
separator = String.fromCharCode(160),
|
||||||
username = '',
|
username = '',
|
||||||
usergroups,
|
usergroups,
|
||||||
permissions;
|
reviewPermissions,
|
||||||
|
reviewGroups;
|
||||||
return {
|
return {
|
||||||
setParser: function(value) {
|
setParser: function(value) {
|
||||||
parse = !!value;
|
parse = !!value;
|
||||||
|
@ -1002,23 +1003,27 @@ Common.Utils.UserInfoParser = new(function() {
|
||||||
|
|
||||||
setCurrentName: function(name) {
|
setCurrentName: function(name) {
|
||||||
username = name;
|
username = name;
|
||||||
this.setReviewPermissions(permissions);
|
this.setReviewPermissions(reviewGroups, reviewPermissions);
|
||||||
},
|
},
|
||||||
|
|
||||||
getCurrentName: function() {
|
getCurrentName: function() {
|
||||||
return username;
|
return username;
|
||||||
},
|
},
|
||||||
|
|
||||||
setReviewPermissions: function(reviewPermissions) {
|
setReviewPermissions: function(groups, permissions) {
|
||||||
if (reviewPermissions) {
|
if (groups) {
|
||||||
|
if (typeof groups == 'object' && groups.length>0)
|
||||||
|
usergroups = groups;
|
||||||
|
reviewGroups = groups;
|
||||||
|
} else if (permissions) {
|
||||||
var arr = [],
|
var arr = [],
|
||||||
groups = this.getParsedGroups(username);
|
arrgroups = this.getParsedGroups(username);
|
||||||
groups && groups.forEach(function(group) {
|
arrgroups && arrgroups.forEach(function(group) {
|
||||||
var item = reviewPermissions[group.trim()];
|
var item = permissions[group.trim()];
|
||||||
item && (arr = arr.concat(item));
|
item && (arr = arr.concat(item));
|
||||||
});
|
});
|
||||||
usergroups = arr;
|
usergroups = arr;
|
||||||
permissions = reviewPermissions;
|
reviewPermissions = permissions;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1319,10 +1319,11 @@ define([
|
||||||
this.appOptions.canFavorite = this.document.info && (this.document.info.favorite!==undefined && this.document.info.favorite!==null) && !this.appOptions.isOffline;
|
this.appOptions.canFavorite = this.document.info && (this.document.info.favorite!==undefined && this.document.info.favorite!==null) && !this.appOptions.isOffline;
|
||||||
this.appOptions.canFavorite && appHeader.setFavorite(this.document.info.favorite);
|
this.appOptions.canFavorite && appHeader.setFavorite(this.document.info.favorite);
|
||||||
|
|
||||||
this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object');
|
this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && (!!this.permissions.reviewGroup ||
|
||||||
|
this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object'));
|
||||||
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions);
|
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions);
|
||||||
Common.Utils.UserInfoParser.setCurrentName(this.appOptions.user.fullname);
|
Common.Utils.UserInfoParser.setCurrentName(this.appOptions.user.fullname);
|
||||||
this.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(this.editorConfig.customization.reviewPermissions);
|
this.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(this.permissions.reviewGroup, this.editorConfig.customization.reviewPermissions);
|
||||||
appHeader.setUserName(Common.Utils.UserInfoParser.getParsedName(Common.Utils.UserInfoParser.getCurrentName()));
|
appHeader.setUserName(Common.Utils.UserInfoParser.getParsedName(Common.Utils.UserInfoParser.getCurrentName()));
|
||||||
|
|
||||||
this.appOptions.canRename && appHeader.setCanRename(true);
|
this.appOptions.canRename && appHeader.setCanRename(true);
|
||||||
|
|
|
@ -837,10 +837,11 @@ define([
|
||||||
me.appOptions.canUseHistory = me.appOptions.canReview = me.appOptions.isReviewOnly = false;
|
me.appOptions.canUseHistory = me.appOptions.canReview = me.appOptions.isReviewOnly = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
me.appOptions.canUseReviewPermissions = me.appOptions.canLicense && me.editorConfig.customization && me.editorConfig.customization.reviewPermissions && (typeof (me.editorConfig.customization.reviewPermissions) == 'object');
|
me.appOptions.canUseReviewPermissions = me.appOptions.canLicense && (!!me.permissions.reviewGroup ||
|
||||||
|
me.editorConfig.customization && me.editorConfig.customization.reviewPermissions && (typeof (me.editorConfig.customization.reviewPermissions) == 'object'));
|
||||||
Common.Utils.UserInfoParser.setParser(me.appOptions.canUseReviewPermissions);
|
Common.Utils.UserInfoParser.setParser(me.appOptions.canUseReviewPermissions);
|
||||||
Common.Utils.UserInfoParser.setCurrentName(me.appOptions.user.fullname);
|
Common.Utils.UserInfoParser.setCurrentName(me.appOptions.user.fullname);
|
||||||
me.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(this.editorConfig.customization.reviewPermissions);
|
me.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(me.permissions.reviewGroup, me.editorConfig.customization.reviewPermissions);
|
||||||
|
|
||||||
me.applyModeCommonElements();
|
me.applyModeCommonElements();
|
||||||
me.applyModeEditorElements();
|
me.applyModeEditorElements();
|
||||||
|
|
|
@ -1025,10 +1025,11 @@ define([
|
||||||
this.appOptions.canFavorite = this.document.info && (this.document.info.favorite!==undefined && this.document.info.favorite!==null) && !this.appOptions.isOffline;
|
this.appOptions.canFavorite = this.document.info && (this.document.info.favorite!==undefined && this.document.info.favorite!==null) && !this.appOptions.isOffline;
|
||||||
this.appOptions.canFavorite && appHeader.setFavorite(this.document.info.favorite);
|
this.appOptions.canFavorite && appHeader.setFavorite(this.document.info.favorite);
|
||||||
|
|
||||||
this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object');
|
this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && (!!this.permissions.reviewGroup ||
|
||||||
|
this.appOptions.canLicense && this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object'));
|
||||||
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions);
|
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions);
|
||||||
Common.Utils.UserInfoParser.setCurrentName(this.appOptions.user.fullname);
|
Common.Utils.UserInfoParser.setCurrentName(this.appOptions.user.fullname);
|
||||||
this.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(this.editorConfig.customization.reviewPermissions);
|
this.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(this.permissions.reviewGroup, this.editorConfig.customization.reviewPermissions);
|
||||||
appHeader.setUserName(Common.Utils.UserInfoParser.getParsedName(Common.Utils.UserInfoParser.getCurrentName()));
|
appHeader.setUserName(Common.Utils.UserInfoParser.getParsedName(Common.Utils.UserInfoParser.getCurrentName()));
|
||||||
|
|
||||||
this.appOptions.canRename && appHeader.setCanRename(true);
|
this.appOptions.canRename && appHeader.setCanRename(true);
|
||||||
|
|
|
@ -755,10 +755,11 @@ define([
|
||||||
me.appOptions.canBranding = params.asc_getCustomization();
|
me.appOptions.canBranding = params.asc_getCustomization();
|
||||||
me.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof me.editorConfig.customization == 'object');
|
me.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof me.editorConfig.customization == 'object');
|
||||||
|
|
||||||
me.appOptions.canUseReviewPermissions = me.appOptions.canLicense && me.editorConfig.customization && me.editorConfig.customization.reviewPermissions && (typeof (me.editorConfig.customization.reviewPermissions) == 'object');
|
me.appOptions.canUseReviewPermissions = me.appOptions.canLicense && (!!me.permissions.reviewGroup ||
|
||||||
|
me.editorConfig.customization && me.editorConfig.customization.reviewPermissions && (typeof (me.editorConfig.customization.reviewPermissions) == 'object'));
|
||||||
Common.Utils.UserInfoParser.setParser(me.appOptions.canUseReviewPermissions);
|
Common.Utils.UserInfoParser.setParser(me.appOptions.canUseReviewPermissions);
|
||||||
Common.Utils.UserInfoParser.setCurrentName(me.appOptions.user.fullname);
|
Common.Utils.UserInfoParser.setCurrentName(me.appOptions.user.fullname);
|
||||||
me.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(me.editorConfig.customization.reviewPermissions);
|
me.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(me.permissions.reviewGroup, me.editorConfig.customization.reviewPermissions);
|
||||||
|
|
||||||
me.applyModeCommonElements();
|
me.applyModeCommonElements();
|
||||||
me.applyModeEditorElements();
|
me.applyModeEditorElements();
|
||||||
|
|
|
@ -1070,10 +1070,11 @@ define([
|
||||||
this.appOptions.canFavorite && this.headerView && this.headerView.setFavorite(this.appOptions.spreadsheet.info.favorite);
|
this.appOptions.canFavorite && this.headerView && this.headerView.setFavorite(this.appOptions.spreadsheet.info.favorite);
|
||||||
|
|
||||||
this.appOptions.canRename && this.headerView.setCanRename(true);
|
this.appOptions.canRename && this.headerView.setCanRename(true);
|
||||||
this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object');
|
this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && (!!this.permissions.reviewGroup ||
|
||||||
|
this.appOptions.canLicense && this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object'));
|
||||||
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions);
|
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions);
|
||||||
Common.Utils.UserInfoParser.setCurrentName(this.appOptions.user.fullname);
|
Common.Utils.UserInfoParser.setCurrentName(this.appOptions.user.fullname);
|
||||||
this.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(this.editorConfig.customization.reviewPermissions);
|
this.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(this.permissions.reviewGroup, this.editorConfig.customization.reviewPermissions);
|
||||||
this.headerView.setUserName(Common.Utils.UserInfoParser.getParsedName(Common.Utils.UserInfoParser.getCurrentName()));
|
this.headerView.setUserName(Common.Utils.UserInfoParser.getParsedName(Common.Utils.UserInfoParser.getCurrentName()));
|
||||||
} else
|
} else
|
||||||
this.appOptions.canModifyFilter = true;
|
this.appOptions.canModifyFilter = true;
|
||||||
|
|
|
@ -766,10 +766,11 @@ define([
|
||||||
me.appOptions.canBranding = params.asc_getCustomization();
|
me.appOptions.canBranding = params.asc_getCustomization();
|
||||||
me.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof me.editorConfig.customization == 'object');
|
me.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof me.editorConfig.customization == 'object');
|
||||||
|
|
||||||
me.appOptions.canUseReviewPermissions = me.appOptions.canLicense && me.editorConfig.customization && me.editorConfig.customization.reviewPermissions && (typeof (me.editorConfig.customization.reviewPermissions) == 'object');
|
me.appOptions.canUseReviewPermissions = me.appOptions.canLicense && (!!me.permissions.reviewGroup ||
|
||||||
|
me.editorConfig.customization && me.editorConfig.customization.reviewPermissions && (typeof (me.editorConfig.customization.reviewPermissions) == 'object'));
|
||||||
Common.Utils.UserInfoParser.setParser(me.appOptions.canUseReviewPermissions);
|
Common.Utils.UserInfoParser.setParser(me.appOptions.canUseReviewPermissions);
|
||||||
Common.Utils.UserInfoParser.setCurrentName(me.appOptions.user.fullname);
|
Common.Utils.UserInfoParser.setCurrentName(me.appOptions.user.fullname);
|
||||||
me.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(me.editorConfig.customization.reviewPermissions);
|
me.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(me.permissions.reviewGroup, me.editorConfig.customization.reviewPermissions);
|
||||||
}
|
}
|
||||||
|
|
||||||
me.appOptions.canRequestEditRights = me.editorConfig.canRequestEditRights;
|
me.appOptions.canRequestEditRights = me.editorConfig.canRequestEditRights;
|
||||||
|
|
Loading…
Reference in a new issue