Change api config: add user.group parameter used for customization.reviewPermissions (added as prefix).
Use nbsp separator for username prefix.
This commit is contained in:
parent
cf35554730
commit
be2924ef60
|
@ -70,7 +70,8 @@
|
|||
|
||||
user: {
|
||||
id: 'user id',
|
||||
name: 'user name'
|
||||
name: 'user name',
|
||||
group: 'group name' // for customization.reviewPermissions parameter
|
||||
},
|
||||
recent: [
|
||||
{
|
||||
|
@ -113,6 +114,11 @@
|
|||
blank: true,
|
||||
requestClose: false // if true - goback send onRequestClose event instead opening url
|
||||
},
|
||||
reviewPermissions: {
|
||||
"Group1": ["Group2"], // users from Group1 can accept/reject review changes made by users from Group2
|
||||
"Group2": ["Group1", "Group2"] // users from Group2 can accept/reject review changes made by users from Group1 and Group2
|
||||
"Group3": [""] // users from Group3 can accept/reject review changes made by users without a group
|
||||
},
|
||||
chat: true,
|
||||
comments: true,
|
||||
zoom: 100,
|
||||
|
|
|
@ -712,6 +712,7 @@ Common.Utils.fillUserInfo = function(info, lang, defname) {
|
|||
var _user = info || {};
|
||||
!_user.id && (_user.id = ('uid-' + Date.now()));
|
||||
_user.fullname = _.isEmpty(_user.name) ? defname : _user.name;
|
||||
_user.group && (_user.fullname = (_user.group).toString() + Common.Utils.UserInfoParser.getSeparator() + _user.fullname);
|
||||
return _user;
|
||||
};
|
||||
|
||||
|
@ -963,21 +964,26 @@ Common.Utils.ModalWindow = new(function() {
|
|||
|
||||
Common.Utils.UserInfoParser = new(function() {
|
||||
var parse = false;
|
||||
var separator = String.fromCharCode(160);
|
||||
return {
|
||||
setParser: function(value) {
|
||||
parse = !!value;
|
||||
},
|
||||
|
||||
getSeparator: function() {
|
||||
return separator;
|
||||
},
|
||||
|
||||
getParsedName: function(username) {
|
||||
if (parse && username) {
|
||||
return username.substring(username.indexOf(':')+1);
|
||||
return username.substring(username.indexOf(separator)+1);
|
||||
} else
|
||||
return username;
|
||||
},
|
||||
|
||||
getParsedGroups: function(username) {
|
||||
if (parse && username) {
|
||||
var idx = username.indexOf(':'),
|
||||
var idx = username.indexOf(separator),
|
||||
groups = (idx>-1) ? username.substring(0, idx).split(',') : [];
|
||||
for (var i=0; i<groups.length; i++)
|
||||
groups[i] = groups[i].trim();
|
||||
|
|
|
@ -127,31 +127,4 @@ define([
|
|||
}, 500);
|
||||
}
|
||||
};
|
||||
|
||||
Common.Utils.UserInfoParser = new(function() {
|
||||
var parse = false;
|
||||
return {
|
||||
setParser: function(value) {
|
||||
parse = !!value;
|
||||
},
|
||||
|
||||
getParsedName: function(username) {
|
||||
if (parse && username) {
|
||||
return username.substring(username.indexOf(':')+1);
|
||||
} else
|
||||
return username;
|
||||
},
|
||||
|
||||
getParsedGroups: function(username) {
|
||||
if (parse && username) {
|
||||
var idx = username.indexOf(':'),
|
||||
groups = (idx>-1) ? username.substring(0, idx).split(',') : [];
|
||||
for (var i=0; i<groups.length; i++)
|
||||
groups[i] = groups[i].trim();
|
||||
return groups;
|
||||
} else
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
})();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue