diff --git a/apps/common/mobile/lib/controller/collaboration/Review.jsx b/apps/common/mobile/lib/controller/collaboration/Review.jsx index 6f212ef94..d8a42eaf7 100644 --- a/apps/common/mobile/lib/controller/collaboration/Review.jsx +++ b/apps/common/mobile/lib/controller/collaboration/Review.jsx @@ -135,33 +135,8 @@ class ReviewChange extends Component { this.onDeleteChange = this.onDeleteChange.bind(this); this.appConfig = props.storeAppOptions; - - if (this.appConfig && this.appConfig.canUseReviewPermissions) { - const permissions = this.appConfig.customization.reviewPermissions; - let arr = []; - const groups = Common.Utils.UserInfoParser.getParsedGroups(Common.Utils.UserInfoParser.getCurrentName()); - groups && groups.forEach(function(group) { - const item = permissions[group.trim()]; - item && (arr = arr.concat(item)); - }); - this.currentUserGroups = arr; - } - } - intersection (arr1, arr2) { //Computes the list of values that are the intersection of all the arrays. - const arr = []; - arr1.forEach((item1) => { - arr2.forEach((item2) => { - if (item1 === item2) { - arr.push(item2); - } - }); - }); - return arr; - } - checkUserGroups (username) { - const groups = Common.Utils.UserInfoParser.getParsedGroups(username); - return this.currentUserGroups && groups && (this.intersection(this.currentUserGroups, (groups.length>0) ? groups : [""]).length>0); } + dateToLocaleTimeString (date) { const format = (date) => { let strTime, @@ -445,7 +420,7 @@ class ReviewChange extends Component { const userColor = item.get_UserColor(); const goto = (item.get_MoveType() == Asc.c_oAscRevisionsMove.MoveTo || item.get_MoveType() == Asc.c_oAscRevisionsMove.MoveFrom); date = this.dateToLocaleTimeString(date); - const editable = this.appConfig.isReviewOnly && (item.get_UserId() == this.appConfig.user.id) || !this.appConfig.isReviewOnly && (!this.appConfig.canUseReviewPermissions || this.checkUserGroups(item.get_UserName())); + const editable = this.appConfig.isReviewOnly && (item.get_UserId() == this.appConfig.user.id) || !this.appConfig.isReviewOnly && (!this.appConfig.canUseReviewPermissions || AscCommon.UserInfoParser.canEditReview(item.get_UserName())); arr.push({date: date, user: user, userColor: userColor, changeText: changeText, goto: goto, editable: editable}); }); return arr; @@ -496,7 +471,7 @@ class ReviewChange extends Component { change = { date: arrChangeReview[0].date, user: arrChangeReview[0].user, - userName: Common.Utils.String.htmlEncode(Common.Utils.UserInfoParser.getParsedName(arrChangeReview[0].user)), + userName: Common.Utils.String.htmlEncode(AscCommon.UserInfoParser.getParsedName(arrChangeReview[0].user)), color: arrChangeReview[0].userColor.get_hex(), text: arrChangeReview[0].changeText, initials: this.props.users.getInitials(arrChangeReview[0].user), diff --git a/apps/common/mobile/lib/store/users.js b/apps/common/mobile/lib/store/users.js index 6ca3c140d..776c6e408 100644 --- a/apps/common/mobile/lib/store/users.js +++ b/apps/common/mobile/lib/store/users.js @@ -52,7 +52,7 @@ export class storeUsers { } getInitials (name) { - const fio = Common.Utils.UserInfoParser.getParsedName(name).split(' '); + const fio = AscCommon.UserInfoParser.getParsedName(name).split(' '); let initials = fio[0].substring(0, 1).toUpperCase(); for (let i = fio.length-1; i>0; i--) { if (fio[i][0]!=='(' && fio[i][0]!==')') { diff --git a/apps/documenteditor/mobile/src/controller/ContextMenu.jsx b/apps/documenteditor/mobile/src/controller/ContextMenu.jsx index d53bec6bb..c205270ce 100644 --- a/apps/documenteditor/mobile/src/controller/ContextMenu.jsx +++ b/apps/documenteditor/mobile/src/controller/ContextMenu.jsx @@ -36,7 +36,7 @@ class ContextMenu extends ContextMenuController { getUserName(id) { const user = this.props.users.searchUserByCurrentId(id); - return Common.Utils.UserInfoParser.getParsedName(user.asc_getUserName()); + return AscCommon.UserInfoParser.getParsedName(user.asc_getUserName()); } componentWillUnmount() { diff --git a/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx b/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx index 53ceb4ab3..32fd55220 100644 --- a/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx +++ b/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx @@ -54,7 +54,7 @@ class DocumentInfoController extends Component { let valueModifiedBy = this.docProps.asc_getLastModifiedBy(); if (valueModifiedBy) { - return Common.Utils.UserInfoParser.getParsedName(valueModifiedBy); + return AscCommon.UserInfoParser.getParsedName(valueModifiedBy); } } diff --git a/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx b/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx index b24854c41..3fbdd6566 100644 --- a/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx +++ b/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx @@ -33,7 +33,7 @@ class ContextMenu extends ContextMenuController { getUserName(id) { const user = this.props.users.searchUserByCurrentId(id); - return Common.Utils.UserInfoParser.getParsedName(user.asc_getUserName()); + return AscCommon.UserInfoParser.getParsedName(user.asc_getUserName()); } componentWillUnmount() { diff --git a/apps/presentationeditor/mobile/src/controller/settings/PresentationInfo.jsx b/apps/presentationeditor/mobile/src/controller/settings/PresentationInfo.jsx index eea17514a..688c76271 100644 --- a/apps/presentationeditor/mobile/src/controller/settings/PresentationInfo.jsx +++ b/apps/presentationeditor/mobile/src/controller/settings/PresentationInfo.jsx @@ -49,7 +49,7 @@ class PresentationInfoController extends Component { let valueModifiedBy = this.docProps.asc_getLastModifiedBy(); if (valueModifiedBy) { - return Common.Utils.UserInfoParser.getParsedName(valueModifiedBy); + return AscCommon.UserInfoParser.getParsedName(valueModifiedBy); } } diff --git a/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx b/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx index 436ccdd7c..4af867c16 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx @@ -34,7 +34,7 @@ class ContextMenu extends ContextMenuController { getUserName(id) { const user = this.props.users.searchUserByCurrentId(id); - return Common.Utils.UserInfoParser.getParsedName(user.asc_getUserName()); + return AscCommon.UserInfoParser.getParsedName(user.asc_getUserName()); } componentWillUnmount() { diff --git a/apps/spreadsheeteditor/mobile/src/controller/settings/SpreadsheetInfo.jsx b/apps/spreadsheeteditor/mobile/src/controller/settings/SpreadsheetInfo.jsx index a3325b307..37c38b3b0 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/settings/SpreadsheetInfo.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/settings/SpreadsheetInfo.jsx @@ -57,7 +57,7 @@ class SpreadsheetInfoController extends Component { getModifiedBy() { let valueModifiedBy = this.docProps.asc_getLastModifiedBy(); if (valueModifiedBy) { - return Common.Utils.UserInfoParser.getParsedName(valueModifiedBy); + return AscCommon.UserInfoParser.getParsedName(valueModifiedBy); } return null; }