Skip to content

Commit df12a5f

Browse files
committed
show "owner"
1 parent e79d068 commit df12a5f

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

services/static-webserver/client/source/class/osparc/dashboard/GridButtonItem.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,14 @@ qx.Class.define("osparc.dashboard.GridButtonItem", {
249249
// overridden
250250
_applyOwner: function(value, old) {
251251
const label = this.getChildControl("subtitle-text");
252-
const user = this.__createOwner(value);
253-
label.setValue(user);
254-
label.setVisibility(value ? "visible" : "excluded");
252+
if (osparc.utils.Resources.isFunction(this.getResourceData())) {
253+
const canIWrite = Boolean(this.getResourceData()["accessRights"]["write"]);
254+
label.setValue(canIWrite ? "My Function" : "Read Only");
255+
} else {
256+
const user = this.__createOwner(value);
257+
label.setValue(user);
258+
label.setVisibility(value ? "visible" : "excluded");
259+
}
255260
},
256261

257262
_applyAccessRights: function(value) {

services/static-webserver/client/source/class/osparc/dashboard/ListButtonItem.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,13 @@ qx.Class.define("osparc.dashboard.ListButtonItem", {
243243

244244
_applyOwner: function(value, old) {
245245
const label = this.getChildControl("owner");
246-
const user = this.__createOwner(value);
247-
label.setValue(user);
246+
if (osparc.utils.Resources.isFunction(this.getResourceData())) {
247+
const canIWrite = Boolean(this.getResourceData()["accessRights"]["write"]);
248+
label.setValue(canIWrite ? "My Function" : "Read Only");
249+
} else {
250+
const user = this.__createOwner(value);
251+
label.setValue(user);
252+
}
248253

249254
this.__makeItemResponsive(label);
250255
},

services/static-webserver/client/source/class/osparc/info/FunctionLarge.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ qx.Class.define("osparc.info.FunctionLarge", {
120120
},
121121
"ACCESS_RIGHTS": {
122122
label: this.tr("Permissions"),
123-
view: new qx.ui.basic.Label(canIWrite ? "Owner" : "Read Only"),
123+
view: new qx.ui.basic.Label(canIWrite ? "My Function" : "Read Only"),
124124
action: null
125125
},
126126
"CREATED": {

0 commit comments

Comments
 (0)