Skip to content

Commit 316b068

Browse files
committed
isLockedBySomeoneElse
1 parent 90a9eb6 commit 316b068

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

services/static-webserver/client/source/class/osparc/data/model/NodeLockState.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,14 @@ qx.Class.define("osparc.data.model.NodeLockState", {
6565
__currentUserGroupIds: function(currentUserGroupIds) {
6666
console.log("currentUserGroupIds", currentUserGroupIds);
6767
},
68+
69+
isLockedBySomeoneElse: function() {
70+
if (this.isLocked()) {
71+
const currentUserGroupIds = this.getCurrentUserGroupIds();
72+
const myGroupId = osparc.auth.Data.getInstance().getGroupId();
73+
return !currentUserGroupIds.includes(myGroupId);
74+
}
75+
return false;
76+
}
6877
}
6978
});

services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ qx.Class.define("osparc.desktop.WorkbenchView", {
6666
const iFrame = node.getIFrame();
6767
const src = iFrame.getSource();
6868
let showPage = iFrame;
69-
if (node.getStatus().getLockState().isLocked()) {
69+
const nodeLockedState = node.getStatus().getLockState()
70+
if (nodeLockedState.isLocked() && nodeLockedState.isLockedBySomeoneElse()) {
7071
showPage = node.getLockedPage();
7172
} else if (src === null || src === "about:blank") {
7273
showPage = node.getLoadingPage();

0 commit comments

Comments
 (0)