Skip to content

Commit 65a95cd

Browse files
authored
🐛 Bug?fix: template permissions (ITISFoundation#3398)
1 parent 0c2b45f commit 65a95cd

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

services/static-webserver/client/source/class/osparc/component/permissions/Study.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ qx.Class.define("osparc.component.permissions.Study", {
3131
* @param studyData {Object} Object containing the serialized Study Data
3232
*/
3333
construct: function(studyData) {
34+
// this info is lost when we deepCloneStudyObject
35+
this.__resourceType = studyData["resourceType"];
3436
this.__studyData = osparc.data.model.Study.deepCloneStudyObject(studyData);
3537

3638
const initCollabs = [];
3739
if (osparc.data.Permissions.getInstance().canDo("study.everyone.share")) {
38-
initCollabs.push(this.self().getEveryoneObj());
40+
initCollabs.push(this.self().getEveryoneObj(this.__resourceType === "study"));
3941
}
4042
this.base(arguments, this.__studyData, initCollabs);
4143
},
@@ -95,20 +97,21 @@ qx.Class.define("osparc.component.permissions.Study", {
9597
return delete studyData["accessRights"][gid];
9698
},
9799

98-
getEveryoneObj: function() {
100+
getEveryoneObj: function(isResourceStudy) {
99101
return {
100102
"gid": 1,
101103
"label": "Everyone",
102104
"description": "",
103105
"thumbnail": null,
104-
"accessRights": this.getCollaboratorAccessRight(),
106+
"accessRights": isResourceStudy ? this.getCollaboratorAccessRight() : this.getViewerAccessRight(),
105107
"collabType": 0
106108
};
107109
}
108110
},
109111

110112
members: {
111113
__studyData: null,
114+
__resourceType: null,
112115

113116
_isUserOwner: function() {
114117
return osparc.data.model.Study.isOwner(this.__studyData);
@@ -121,7 +124,7 @@ qx.Class.define("osparc.component.permissions.Study", {
121124
}
122125

123126
gids.forEach(gid => {
124-
this.__studyData["accessRights"][gid] = this.self().getCollaboratorAccessRight();
127+
this.__studyData["accessRights"][gid] = this.__resourceType === "study" ? this.self().getCollaboratorAccessRight() : this.self().getViewerAccessRight();
125128
});
126129
const params = {
127130
url: {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ qx.Class.define("osparc.dashboard.GridButtonBase", {
8282
maxWidth: this.self().ITEM_WIDTH - 2*this.self().PADDING,
8383
maxHeight: 34, // two lines
8484
rich: true,
85-
wrap: true,
86-
breakWithinWords: true
85+
wrap: true
8786
});
8887
this._mainLayout.addAt(control, this.self().POS.TITLE);
8988
break;

0 commit comments

Comments
 (0)