Add permissions for edit/remove comments

This commit is contained in:
Julia Radzhabova 2021-03-17 12:02:06 +03:00
parent 5a373f76bb
commit f35e929713
12 changed files with 115 additions and 53 deletions

View file

@ -51,6 +51,11 @@
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,
reviewGroups: ["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 reviewGroups: ["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
commentGroups: { // {} - use groups, but can't view/edit/delete any group's comments
view: ["Group1", ""] // current user can view comments made by users from Group1 and users without a group.
edit: ["Group1", ""] // current user can edit comments made by users from Group1 and users without a group.
remove: ["Group1", ""] // current user can remove comments made by users from Group1 and users without a group.
}
} }
}, },
editorConfig: { editorConfig: {

View file

@ -776,8 +776,8 @@ define([
comment.set('userdata', data.asc_getUserData()); comment.set('userdata', data.asc_getUserData());
comment.set('time', date.getTime()); comment.set('time', date.getTime());
comment.set('date', t.dateToLocaleTimeString(date)); comment.set('date', t.dateToLocaleTimeString(date));
comment.set('editable', t.mode.canEditComments || (data.asc_getUserId() == t.currentUserId)); comment.set('editable', (t.mode.canEditComments || (data.asc_getUserId() == t.currentUserId)) && Common.Utils.UserInfoParser.canEditComment(data.asc_getUserName()));
comment.set('removable', t.mode.canDeleteComments || (data.asc_getUserId() == t.currentUserId)); comment.set('removable', (t.mode.canDeleteComments || (data.asc_getUserId() == t.currentUserId)) && Common.Utils.UserInfoParser.canDeleteComment(data.asc_getUserName()));
replies = _.clone(comment.get('replys')); replies = _.clone(comment.get('replys'));
@ -803,8 +803,8 @@ define([
editTextInPopover : false, editTextInPopover : false,
showReplyInPopover : false, showReplyInPopover : false,
scope : t.view, scope : t.view,
editable : t.mode.canEditComments || (data.asc_getReply(i).asc_getUserId() == t.currentUserId), editable : (t.mode.canEditComments || (data.asc_getReply(i).asc_getUserId() == t.currentUserId)) && Common.Utils.UserInfoParser.canEditComment(data.asc_getReply(i).asc_getUserName()),
removable : t.mode.canDeleteComments || (data.asc_getReply(i).asc_getUserId() == t.currentUserId) removable : (t.mode.canDeleteComments || (data.asc_getReply(i).asc_getUserId() == t.currentUserId)) && Common.Utils.UserInfoParser.canDeleteComment(data.asc_getReply(i).asc_getUserName())
})); }));
} }
@ -1243,8 +1243,8 @@ define([
showReplyInPopover : false, showReplyInPopover : false,
hideAddReply : !_.isUndefined(this.hidereply) ? this.hidereply : (this.showPopover ? true : false), hideAddReply : !_.isUndefined(this.hidereply) ? this.hidereply : (this.showPopover ? true : false),
scope : this.view, scope : this.view,
editable : this.mode.canEditComments || (data.asc_getUserId() == this.currentUserId), editable : (this.mode.canEditComments || (data.asc_getUserId() == this.currentUserId)) && Common.Utils.UserInfoParser.canEditComment(data.asc_getUserName()),
removable : this.mode.canDeleteComments || (data.asc_getUserId() == this.currentUserId), removable : (this.mode.canDeleteComments || (data.asc_getUserId() == this.currentUserId)) && Common.Utils.UserInfoParser.canDeleteComment(data.asc_getUserName()),
hint : !this.mode.canComments, hint : !this.mode.canComments,
groupName : (groupname && groupname.length>1) ? groupname[1] : null groupName : (groupname && groupname.length>1) ? groupname[1] : null
}); });
@ -1281,8 +1281,8 @@ define([
editTextInPopover : false, editTextInPopover : false,
showReplyInPopover : false, showReplyInPopover : false,
scope : this.view, scope : this.view,
editable : this.mode.canEditComments || (data.asc_getReply(i).asc_getUserId() == this.currentUserId), editable : (this.mode.canEditComments || (data.asc_getReply(i).asc_getUserId() == this.currentUserId)) && Common.Utils.UserInfoParser.canEditComment(data.asc_getReply(i).asc_getUserName()),
removable : this.mode.canDeleteComments || (data.asc_getReply(i).asc_getUserId() == this.currentUserId) removable : (this.mode.canDeleteComments || (data.asc_getReply(i).asc_getUserId() == this.currentUserId)) && Common.Utils.UserInfoParser.canDeleteComment(data.asc_getReply(i).asc_getUserName())
})); }));
} }
} }
@ -1443,7 +1443,7 @@ define([
for (i = 0; i < comments.length; ++i) { for (i = 0; i < comments.length; ++i) {
comment = this.findComment(comments[i].asc_getId()); comment = this.findComment(comments[i].asc_getId());
if (comment) { if (comment) {
comment.set('editTextInPopover', t.mode.canEditComments);// dont't edit comment when customization->commentAuthorOnly is true or when permissions.editCommentAuthorOnly is true comment.set('editTextInPopover', t.mode.canEditComments && Common.Utils.UserInfoParser.canEditComment(comment.username));// dont't edit comment when customization->commentAuthorOnly is true or when permissions.editCommentAuthorOnly is true
comment.set('hint', false); comment.set('hint', false);
this.popoverComments.push(comment); this.popoverComments.push(comment);
} }

View file

@ -73,7 +73,9 @@
<% if (removable) { %> <% if (removable) { %>
<div class="btn-delete img-commonctrl"></div> <div class="btn-delete img-commonctrl"></div>
<% } %> <% } %>
<% if (editable) { %>
<div class="btn-resolve <% if (resolved) print('comment-resolved') %>" data-toggle="tooltip"></div> <div class="btn-resolve <% if (resolved) print('comment-resolved') %>" data-toggle="tooltip"></div>
<% } %>
</div> </div>
<% } %> <% } %>

View file

@ -74,7 +74,9 @@
<% if (removable) { %> <% if (removable) { %>
<div class="btn-delete img-commonctrl"></div> <div class="btn-delete img-commonctrl"></div>
<% } %> <% } %>
<% if (editable) { %>
<div class="btn-resolve <% if (resolved) print('comment-resolved') %>" data-toggle="tooltip"></div> <div class="btn-resolve <% if (resolved) print('comment-resolved') %>" data-toggle="tooltip"></div>
<% } %>
</div> </div>
<% } %> <% } %>

View file

@ -982,9 +982,20 @@ Common.Utils.UserInfoParser = new(function() {
var parse = false, var parse = false,
separator = String.fromCharCode(160), separator = String.fromCharCode(160),
username = '', username = '',
usergroups, _reviewPermissions,
reviewPermissions, reviewGroups,
reviewGroups; commentGroups;
var _intersection = function (arr1, arr2) {
if (arr1 && arr2) {
for (var i=0; i<arr2.length; i++) {
if (arr1.indexOf(arr2[i])>-1)
return true;
}
}
return false;
};
return { return {
setParser: function(value) { setParser: function(value) {
parse = !!value; parse = !!value;
@ -995,10 +1006,7 @@ Common.Utils.UserInfoParser = new(function() {
}, },
getParsedName: function(username) { getParsedName: function(username) {
if (parse && username) { return (parse && username) ? username.substring(username.indexOf(separator)+1) : username;
return username.substring(username.indexOf(separator)+1);
} else
return username;
}, },
getParsedGroups: function(username) { getParsedGroups: function(username) {
@ -1008,13 +1016,12 @@ Common.Utils.UserInfoParser = new(function() {
for (var i=0; i<groups.length; i++) for (var i=0; i<groups.length; i++)
groups[i] = groups[i].trim(); groups[i] = groups[i].trim();
return groups; return groups;
} else }
return undefined;
}, },
setCurrentName: function(name) { setCurrentName: function(name) {
username = name; username = name;
this.setReviewPermissions(reviewGroups, reviewPermissions); _reviewPermissions && this.setReviewPermissions(null, _reviewPermissions); // old version of review permissions
}, },
getCurrentName: function() { getCurrentName: function() {
@ -1024,27 +1031,59 @@ Common.Utils.UserInfoParser = new(function() {
setReviewPermissions: function(groups, permissions) { setReviewPermissions: function(groups, permissions) {
if (groups) { if (groups) {
if (typeof groups == 'object' && groups.length>0) if (typeof groups == 'object' && groups.length>0)
usergroups = groups;
reviewGroups = groups; reviewGroups = groups;
} else if (permissions) { } else if (permissions) { // old version of review permissions
var arr = [], var arr = [],
arrgroups = this.getParsedGroups(username); arrgroups = this.getParsedGroups(username);
arrgroups && arrgroups.forEach(function(group) { arrgroups && arrgroups.forEach(function(group) {
var item = permissions[group.trim()]; var item = permissions[group.trim()];
item && (arr = arr.concat(item)); item && (arr = arr.concat(item));
}); });
usergroups = arr; reviewGroups = arr;
reviewPermissions = permissions; _reviewPermissions = permissions;
} }
}, },
getCurrentGroups: function() { setCommentPermissions: function(groups) {
return usergroups; if (groups && typeof groups == 'object') {
commentGroups = {
view: (typeof groups.view == 'object' && groups.view.length>0) ? groups.view : null,
edit: (typeof groups.edit == 'object' && groups.edit.length>0) ? groups.edit : null,
remove: (typeof groups.remove == 'object' && groups.remove.length>0) ? groups.remove : null
};
}
}, },
canEditReview: function(username) { canEditReview: function(username) {
if (!parse || !reviewGroups) return true;
var groups = this.getParsedGroups(username); var groups = this.getParsedGroups(username);
return usergroups && groups && (_.intersection(usergroups, (groups.length>0) ? groups : [""]).length>0); groups && (groups.length==0) && (groups = [""]);
return _intersection(reviewGroups, groups);
},
canViewComment: function(username) {
if (!parse || !commentGroups) return true;
var groups = this.getParsedGroups(username);
groups && (groups.length==0) && (groups = [""]);
return _intersection(commentGroups.view, groups);
},
canEditComment: function(username) {
if (!parse || !commentGroups) return true;
var groups = this.getParsedGroups(username);
groups && (groups.length==0) && (groups = [""]);
return _intersection(commentGroups.edit, groups);
},
canDeleteComment: function(username) {
if (!parse || !commentGroups) return true;
var groups = this.getParsedGroups(username);
groups && (groups.length==0) && (groups = [""]);
return _intersection(commentGroups.remove, groups);
} }
} }
})(); })();

View file

@ -1131,6 +1131,7 @@ define([
caption: me.textEdit, caption: me.textEdit,
event: 'edit' event: 'edit'
}); });
if (comment.editable) {
if (!comment.resolved) { if (!comment.resolved) {
_menuItems.push({ _menuItems.push({
caption: me.textResolve, caption: me.textResolve,
@ -1142,6 +1143,7 @@ define([
event: 'resolve' event: 'resolve'
}); });
} }
}
if ($('.container-collaboration').length > 0) { if ($('.container-collaboration').length > 0) {
_menuItems.push({ _menuItems.push({
caption: me.textAddReply, caption: me.textAddReply,
@ -1540,8 +1542,8 @@ define([
reply : data.asc_getReply(i).asc_getText(), reply : data.asc_getReply(i).asc_getText(),
time : date.getTime(), time : date.getTime(),
userInitials : this.getInitials(username), userInitials : this.getInitials(username),
editable : this.appConfig.canEditComments || (data.asc_getReply(i).asc_getUserId() == _userId), editable : (this.appConfig.canEditComments || (data.asc_getReply(i).asc_getUserId() == _userId)) && Common.Utils.UserInfoParser.canEditComment(username),
removable : this.appConfig.canDeleteComments || (data.asc_getReply(i).asc_getUserId() == _userId) removable : (this.appConfig.canDeleteComments || (data.asc_getReply(i).asc_getUserId() == _userId)) && Common.Utils.UserInfoParser.canDeleteComment(username)
}); });
} }
} }
@ -1570,8 +1572,8 @@ define([
replys : [], replys : [],
groupName : (groupname && groupname.length>1) ? groupname[1] : null, groupName : (groupname && groupname.length>1) ? groupname[1] : null,
userInitials : this.getInitials(username), userInitials : this.getInitials(username),
editable : this.appConfig.canEditComments || (data.asc_getUserId() == _userId), editable : (this.appConfig.canEditComments || (data.asc_getUserId() == _userId)) && Common.Utils.UserInfoParser.canEditComment(username),
removable : this.appConfig.canDeleteComments || (data.asc_getUserId() == _userId) removable : (this.appConfig.canDeleteComments || (data.asc_getUserId() == _userId)) && Common.Utils.UserInfoParser.canDeleteComment(username)
}; };
if (comment) { if (comment) {
var replies = this.readSDKReplies(data); var replies = this.readSDKReplies(data);
@ -1607,8 +1609,8 @@ define([
comment.quote = data.asc_getQuoteText(); comment.quote = data.asc_getQuoteText();
comment.time = date.getTime(); comment.time = date.getTime();
comment.date = me.dateToLocaleTimeString(date); comment.date = me.dateToLocaleTimeString(date);
comment.editable = me.appConfig.canEditComments || (data.asc_getUserId() == _userId); comment.editable = (me.appConfig.canEditComments || (data.asc_getUserId() == _userId)) && Common.Utils.UserInfoParser.canEditComment(data.asc_getUserName());
comment.removable = me.appConfig.canDeleteComments || (data.asc_getUserId() == _userId); comment.removable = (me.appConfig.canDeleteComments || (data.asc_getUserId() == _userId)) && Common.Utils.UserInfoParser.canDeleteComment(data.asc_getUserName());
replies = _.clone(comment.replys); replies = _.clone(comment.replys);
@ -1633,8 +1635,8 @@ define([
reply : data.asc_getReply(i).asc_getText(), reply : data.asc_getReply(i).asc_getText(),
time : dateReply.getTime(), time : dateReply.getTime(),
userInitials : me.getInitials(username), userInitials : me.getInitials(username),
editable : me.appConfig.canEditComments || (data.asc_getReply(i).asc_getUserId() == _userId), editable : (me.appConfig.canEditComments || (data.asc_getReply(i).asc_getUserId() == _userId)) && Common.Utils.UserInfoParser.canEditComment(username),
removable : me.appConfig.canDeleteComments || (data.asc_getReply(i).asc_getUserId() == _userId) removable : (me.appConfig.canDeleteComments || (data.asc_getReply(i).asc_getUserId() == _userId)) && Common.Utils.UserInfoParser.canDeleteComment(username)
}); });
} }
comment.replys = replies; comment.replys = replies;

View file

@ -1333,9 +1333,11 @@ define([
this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && (!!this.permissions.reviewGroups || this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && (!!this.permissions.reviewGroups ||
this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object')); this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object'));
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions); this.appOptions.canUseCommentPermissions = this.appOptions.canLicense && !!this.permissions.commentGroups;
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions || this.appOptions.canUseCommentPermissions);
Common.Utils.UserInfoParser.setCurrentName(this.appOptions.user.fullname); Common.Utils.UserInfoParser.setCurrentName(this.appOptions.user.fullname);
this.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(this.permissions.reviewGroups, this.editorConfig.customization.reviewPermissions); this.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(this.permissions.reviewGroups, this.editorConfig.customization.reviewPermissions);
this.appOptions.canUseCommentPermissions && Common.Utils.UserInfoParser.setCommentPermissions(this.permissions.commentGroups);
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);

View file

@ -839,9 +839,11 @@ define([
me.appOptions.canUseReviewPermissions = me.appOptions.canLicense && (!!me.permissions.reviewGroups || me.appOptions.canUseReviewPermissions = me.appOptions.canLicense && (!!me.permissions.reviewGroups ||
me.editorConfig.customization && me.editorConfig.customization.reviewPermissions && (typeof (me.editorConfig.customization.reviewPermissions) == 'object')); me.editorConfig.customization && me.editorConfig.customization.reviewPermissions && (typeof (me.editorConfig.customization.reviewPermissions) == 'object'));
Common.Utils.UserInfoParser.setParser(me.appOptions.canUseReviewPermissions); me.appOptions.canUseCommentPermissions = me.appOptions.canLicense && !!me.permissions.commentGroups;
Common.Utils.UserInfoParser.setParser(me.appOptions.canUseReviewPermissions || me.appOptions.canUseCommentPermissions);
Common.Utils.UserInfoParser.setCurrentName(me.appOptions.user.fullname); Common.Utils.UserInfoParser.setCurrentName(me.appOptions.user.fullname);
me.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(me.permissions.reviewGroups, me.editorConfig.customization.reviewPermissions); me.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(me.permissions.reviewGroups, me.editorConfig.customization.reviewPermissions);
me.appOptions.canUseCommentPermissions && Common.Utils.UserInfoParser.setCommentPermissions(me.permissions.commentGroups);
me.applyModeCommonElements(); me.applyModeCommonElements();
me.applyModeEditorElements(); me.applyModeEditorElements();

View file

@ -1034,9 +1034,11 @@ define([
this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && (!!this.permissions.reviewGroups || this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && (!!this.permissions.reviewGroups ||
this.appOptions.canLicense && this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object')); this.appOptions.canLicense && this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object'));
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions); this.appOptions.canUseCommentPermissions = this.appOptions.canLicense && !!this.permissions.commentGroups;
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions || this.appOptions.canUseCommentPermissions);
Common.Utils.UserInfoParser.setCurrentName(this.appOptions.user.fullname); Common.Utils.UserInfoParser.setCurrentName(this.appOptions.user.fullname);
this.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(this.permissions.reviewGroups, this.editorConfig.customization.reviewPermissions); this.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(this.permissions.reviewGroups, this.editorConfig.customization.reviewPermissions);
this.appOptions.canUseCommentPermissions && Common.Utils.UserInfoParser.setCommentPermissions(this.permissions.commentGroups);
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);

View file

@ -762,9 +762,11 @@ define([
me.appOptions.canUseReviewPermissions = me.appOptions.canLicense && (!!me.permissions.reviewGroups || me.appOptions.canUseReviewPermissions = me.appOptions.canLicense && (!!me.permissions.reviewGroups ||
me.editorConfig.customization && me.editorConfig.customization.reviewPermissions && (typeof (me.editorConfig.customization.reviewPermissions) == 'object')); me.editorConfig.customization && me.editorConfig.customization.reviewPermissions && (typeof (me.editorConfig.customization.reviewPermissions) == 'object'));
Common.Utils.UserInfoParser.setParser(me.appOptions.canUseReviewPermissions); me.appOptions.canUseCommentPermissions = me.appOptions.canLicense && !!me.permissions.commentGroups;
Common.Utils.UserInfoParser.setParser(me.appOptions.canUseReviewPermissions || me.appOptions.canUseCommentPermissions);
Common.Utils.UserInfoParser.setCurrentName(me.appOptions.user.fullname); Common.Utils.UserInfoParser.setCurrentName(me.appOptions.user.fullname);
me.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(me.permissions.reviewGroups, me.editorConfig.customization.reviewPermissions); me.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(me.permissions.reviewGroups, me.editorConfig.customization.reviewPermissions);
me.appOptions.canUseCommentPermissions && Common.Utils.UserInfoParser.setCommentPermissions(me.permissions.commentGroups);
me.applyModeCommonElements(); me.applyModeCommonElements();
me.applyModeEditorElements(); me.applyModeEditorElements();

View file

@ -1081,9 +1081,11 @@ define([
this.appOptions.canRename && this.headerView.setCanRename(true); this.appOptions.canRename && this.headerView.setCanRename(true);
this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && (!!this.permissions.reviewGroups || this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && (!!this.permissions.reviewGroups ||
this.appOptions.canLicense && this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object')); this.appOptions.canLicense && this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object'));
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions); this.appOptions.canUseCommentPermissions = this.appOptions.canLicense && !!this.permissions.commentGroups;
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions || this.appOptions.canUseCommentPermissions);
Common.Utils.UserInfoParser.setCurrentName(this.appOptions.user.fullname); Common.Utils.UserInfoParser.setCurrentName(this.appOptions.user.fullname);
this.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(this.permissions.reviewGroups, this.editorConfig.customization.reviewPermissions); this.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(this.permissions.reviewGroups, this.editorConfig.customization.reviewPermissions);
this.appOptions.canUseCommentPermissions && Common.Utils.UserInfoParser.setCommentPermissions(this.permissions.commentGroups);
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;

View file

@ -774,9 +774,11 @@ define([
me.appOptions.canUseReviewPermissions = me.appOptions.canLicense && (!!me.permissions.reviewGroups || me.appOptions.canUseReviewPermissions = me.appOptions.canLicense && (!!me.permissions.reviewGroups ||
me.editorConfig.customization && me.editorConfig.customization.reviewPermissions && (typeof (me.editorConfig.customization.reviewPermissions) == 'object')); me.editorConfig.customization && me.editorConfig.customization.reviewPermissions && (typeof (me.editorConfig.customization.reviewPermissions) == 'object'));
Common.Utils.UserInfoParser.setParser(me.appOptions.canUseReviewPermissions); me.appOptions.canUseCommentPermissions = me.appOptions.canLicense && !!me.permissions.commentGroups;
Common.Utils.UserInfoParser.setParser(me.appOptions.canUseReviewPermissions || me.appOptions.canUseCommentPermissions);
Common.Utils.UserInfoParser.setCurrentName(me.appOptions.user.fullname); Common.Utils.UserInfoParser.setCurrentName(me.appOptions.user.fullname);
me.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(me.permissions.reviewGroups, me.editorConfig.customization.reviewPermissions); me.appOptions.canUseReviewPermissions && Common.Utils.UserInfoParser.setReviewPermissions(me.permissions.reviewGroups, me.editorConfig.customization.reviewPermissions);
me.appOptions.canUseCommentPermissions && Common.Utils.UserInfoParser.setCommentPermissions(me.permissions.commentGroups);
} }
me.appOptions.canRequestEditRights = me.editorConfig.canRequestEditRights; me.appOptions.canRequestEditRights = me.editorConfig.canRequestEditRights;