[Mobile] Handle permissions.userInfoGroups: hide cursors from users not in userInfoGroups
This commit is contained in:
parent
52b9578299
commit
e49e68743c
|
@ -163,6 +163,8 @@ class ContextMenuController extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
onApiShowForeignCursorLabel(UserId, X, Y, color) {
|
onApiShowForeignCursorLabel(UserId, X, Y, color) {
|
||||||
|
if (!this.isUserVisible(UserId)) return;
|
||||||
|
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
const tipHeight = 20;
|
const tipHeight = 20;
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ class ContextMenu extends ContextMenuController {
|
||||||
this.onApiHideComment = this.onApiHideComment.bind(this);
|
this.onApiHideComment = this.onApiHideComment.bind(this);
|
||||||
this.onApiShowChange = this.onApiShowChange.bind(this);
|
this.onApiShowChange = this.onApiShowChange.bind(this);
|
||||||
this.getUserName = this.getUserName.bind(this);
|
this.getUserName = this.getUserName.bind(this);
|
||||||
|
this.isUserVisible = this.isUserVisible.bind(this);
|
||||||
this.ShowModal = this.ShowModal.bind(this);
|
this.ShowModal = this.ShowModal.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,6 +42,11 @@ class ContextMenu extends ContextMenuController {
|
||||||
return AscCommon.UserInfoParser.getParsedName(user.asc_getUserName());
|
return AscCommon.UserInfoParser.getParsedName(user.asc_getUserName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isUserVisible(id) {
|
||||||
|
const user = this.props.users.searchUserByCurrentId(id);
|
||||||
|
return user ? (user.asc_getIdOriginal()===this.props.users.currentUser.asc_getIdOriginal() || AscCommon.UserInfoParser.isUserVisible(user.asc_getUserName())) : true;
|
||||||
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
super.componentWillUnmount();
|
super.componentWillUnmount();
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ class ContextMenu extends ContextMenuController {
|
||||||
this.onApiShowComment = this.onApiShowComment.bind(this);
|
this.onApiShowComment = this.onApiShowComment.bind(this);
|
||||||
this.onApiHideComment = this.onApiHideComment.bind(this);
|
this.onApiHideComment = this.onApiHideComment.bind(this);
|
||||||
this.getUserName = this.getUserName.bind(this);
|
this.getUserName = this.getUserName.bind(this);
|
||||||
|
this.isUserVisible = this.isUserVisible.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
static closeContextMenu() {
|
static closeContextMenu() {
|
||||||
|
@ -36,6 +37,11 @@ class ContextMenu extends ContextMenuController {
|
||||||
return AscCommon.UserInfoParser.getParsedName(user.asc_getUserName());
|
return AscCommon.UserInfoParser.getParsedName(user.asc_getUserName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isUserVisible(id) {
|
||||||
|
const user = this.props.users.searchUserByCurrentId(id);
|
||||||
|
return user ? (user.asc_getIdOriginal()===this.props.users.currentUser.asc_getIdOriginal() || AscCommon.UserInfoParser.isUserVisible(user.asc_getUserName())) : true;
|
||||||
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
super.componentWillUnmount();
|
super.componentWillUnmount();
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ class ContextMenu extends ContextMenuController {
|
||||||
this.isOpenWindowUser = false;
|
this.isOpenWindowUser = false;
|
||||||
this.timer;
|
this.timer;
|
||||||
this.getUserName = this.getUserName.bind(this);
|
this.getUserName = this.getUserName.bind(this);
|
||||||
|
this.isUserVisible = this.isUserVisible.bind(this);
|
||||||
this.onApiMouseMove = this.onApiMouseMove.bind(this);
|
this.onApiMouseMove = this.onApiMouseMove.bind(this);
|
||||||
this.onApiHyperlinkClick = this.onApiHyperlinkClick.bind(this);
|
this.onApiHyperlinkClick = this.onApiHyperlinkClick.bind(this);
|
||||||
}
|
}
|
||||||
|
@ -43,6 +44,11 @@ class ContextMenu extends ContextMenuController {
|
||||||
return AscCommon.UserInfoParser.getParsedName(user.asc_getUserName());
|
return AscCommon.UserInfoParser.getParsedName(user.asc_getUserName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isUserVisible(id) {
|
||||||
|
const user = this.props.users.searchUserByCurrentId(id);
|
||||||
|
return user ? (user.asc_getIdOriginal()===this.props.users.currentUser.asc_getIdOriginal() || AscCommon.UserInfoParser.isUserVisible(user.asc_getUserName())) : true;
|
||||||
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
super.componentWillUnmount();
|
super.componentWillUnmount();
|
||||||
|
|
||||||
|
@ -277,7 +283,7 @@ class ContextMenu extends ContextMenuController {
|
||||||
$$('.username-tip').remove();
|
$$('.username-tip').remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index_locked ) {
|
if (index_locked && this.isUserVisible(dataarray[index_locked-1].asc_getUserId())) {
|
||||||
const tipHeight = 20;
|
const tipHeight = 20;
|
||||||
let editorOffset = $$("#editor_sdk").offset(),
|
let editorOffset = $$("#editor_sdk").offset(),
|
||||||
XY = [ editorOffset.left - $(window).scrollLeft(), editorOffset.top - $(window).scrollTop()],
|
XY = [ editorOffset.left - $(window).scrollLeft(), editorOffset.top - $(window).scrollTop()],
|
||||||
|
|
Loading…
Reference in a new issue