Skip to content

Commit 8a1dfe1

Browse files
committed
accessRights -> myAccessRights
1 parent 0ea2c68 commit 8a1dfe1

File tree

2 files changed

+6
-20
lines changed

2 files changed

+6
-20
lines changed

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

Lines changed: 3 additions & 17 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-
accessRights: functionData.accessRights || this.getAccessRights(),
40+
myAccessRights: functionData.accessRights || this.getMyAccessRights(),
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-
accessRights: {
102+
myAccessRights: {
103103
check: "Object",
104104
nullable: false,
105-
event: "changeAccessRights",
105+
event: "changeMyAccessRights",
106106
init: {}
107107
},
108108

@@ -134,20 +134,6 @@ qx.Class.define("osparc.data.model.Function", {
134134
},
135135
},
136136

137-
statics: {
138-
canIWrite: function(accessRights) {
139-
const groupsStore = osparc.store.Groups.getInstance();
140-
const gIds = groupsStore.getOrganizationIds();
141-
gIds.push(groupsStore.getMyGroupId());
142-
let canWrite = false;
143-
for (let i=0; i<gIds.length && !canWrite; i++) {
144-
const gid = gIds[i];
145-
canWrite = (gid in accessRights) ? accessRights[gid]["write"] : false;
146-
}
147-
return canWrite;
148-
},
149-
},
150-
151137
members: {
152138
serialize: function(clean = true) {
153139
let jsonObject = {};

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ qx.Class.define("osparc.info.FunctionLarge", {
4646

4747
members: {
4848
__canIWrite: function() {
49-
return osparc.data.model.Function.canIWrite(this.getFunction().getAccessRights());
49+
return this.getFunction().getMyAccessRights()["write"];
5050
},
5151

5252
_rebuildLayout: function() {
@@ -119,8 +119,8 @@ qx.Class.define("osparc.info.FunctionLarge", {
119119
}
120120
},
121121
"ACCESS_RIGHTS": {
122-
label: this.tr("Access"),
123-
view: osparc.info.StudyUtils.createAccessRights(this.getFunction()),
122+
label: this.tr("Permissions"),
123+
view: new qx.ui.basic.Label(canIWrite ? "Owner" : "Read Only"),
124124
action: null
125125
},
126126
"CREATED": {

0 commit comments

Comments
 (0)