Skip to content

Commit b59acb9

Browse files
committed
back to accessRights
1 parent 3839c4f commit b59acb9

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ qx.Class.define("osparc.data.model.Function", {
3737
inputSchema: functionData.inputSchema || this.getInputSchema(),
3838
outputSchema: functionData.outputSchema || this.getOutputSchema(),
3939
defaultInputs: functionData.defaultInputs || this.getDefaultInputs(),
40-
myAccessRights: functionData.accessRights || this.getMyAccessRights(),
40+
accessRights: functionData.accessRights || this.getAccessRights(),
4141
creationDate: functionData.creationDate ? new Date(functionData.creationDate) : this.getCreationDate(),
4242
lastChangeDate: functionData.lastChangeDate ? new Date(functionData.lastChangeDate) : this.getLastChangeDate(),
4343
thumbnail: functionData.thumbnail || this.getThumbnail(),
@@ -99,10 +99,10 @@ qx.Class.define("osparc.data.model.Function", {
9999
init: {}
100100
},
101101

102-
myAccessRights: {
102+
accessRights: {
103103
check: "Object",
104104
nullable: false,
105-
event: "changeMyAccessRights",
105+
event: "changeAccessRights",
106106
init: {}
107107
},
108108

@@ -153,6 +153,10 @@ qx.Class.define("osparc.data.model.Function", {
153153
return jsonObject;
154154
},
155155

156+
canIWrite: function() {
157+
return Boolean(this.getAccessRights()["write"]);
158+
},
159+
156160
patchFunction: function(functionChanges) {
157161
return osparc.store.Functions.patchFunction(this.getUuid(), functionChanges)
158162
.then(() => {

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ qx.Class.define("osparc.info.FunctionLarge", {
4545
},
4646

4747
members: {
48-
__canIWrite: function() {
49-
return this.getFunction().getMyAccessRights()["write"];
50-
},
51-
5248
_rebuildLayout: function() {
5349
this._removeAll();
5450

@@ -95,7 +91,7 @@ qx.Class.define("osparc.info.FunctionLarge", {
9591
},
9692

9793
__infoElements: function() {
98-
const canIWrite = this.__canIWrite();
94+
const canIWrite = this.getFunction().canIWrite();
9995

10096
const infoLayout = {
10197
"TITLE": {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ qx.Class.define("osparc.info.FunctionUtils", {
5151
*/
5252
createOwner: function(func) {
5353
const owner = new qx.ui.basic.Label();
54-
const canIWrite = func.getMyAccessRights()["write"];
54+
const canIWrite = func.canIWrite();
5555
owner.setValue(canIWrite ? "My Function" : "Read Only");
5656
return owner;
5757
},

0 commit comments

Comments
 (0)