Skip to content

Commit c44342b

Browse files
committed
default access rights
1 parent f7f861b commit c44342b

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,17 @@ qx.Class.define("osparc.data.model.Group", {
2828
construct: function(groupData) {
2929
this.base(arguments);
3030

31+
const defaultAccessRights = {
32+
"read": false,
33+
"write": false,
34+
"delete": false,
35+
};
36+
3137
this.set({
3238
groupId: groupData.gid,
3339
label: groupData.label,
3440
description: groupData.description,
35-
accessRights: groupData.accessRights,
41+
accessRights: groupData.accessRights || defaultAccessRights,
3642
thumbnail: groupData.thumbnail,
3743
groupMembers: {},
3844
});
@@ -82,7 +88,7 @@ qx.Class.define("osparc.data.model.Group", {
8288
},
8389

8490
groupType: {
85-
check: ["me", "organization", "support", "productEveryone", "everyone"],
91+
check: ["me", "organization", "support", "chatbot", "productEveryone", "everyone"],
8692
nullable: false,
8793
init: null,
8894
},

services/static-webserver/client/source/class/osparc/store/Groups.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,11 @@ qx.Class.define("osparc.store.Groups", {
106106
const productEveryoneGroup = this.__addToGroupsCache(resp["product"], "productEveryone");
107107
let supportGroup = null;
108108
if ("support" in resp && resp["support"]) {
109-
resp["support"]["accessRights"] = {
110-
"read": false,
111-
"write": false,
112-
"delete": false,
113-
};
114109
supportGroup = this.__addToGroupsCache(resp["support"], "support");
115110
}
111+
let chatbot = null;
116112
if ("chatbot" in resp && resp["chatbot"]) {
117-
const chatbot = new osparc.data.model.Group(resp["chatbot"]);
118-
this.setChatbot(chatbot);
113+
chatbot = this.__addToGroupsCache(resp["chatbot"], "chatbot");
119114
}
120115
const groupMe = this.__addToGroupsCache(resp["me"], "me");
121116
const orgs = {};
@@ -131,6 +126,7 @@ qx.Class.define("osparc.store.Groups", {
131126
this.setEveryoneGroup(everyoneGroup);
132127
this.setEveryoneProductGroup(productEveryoneGroup);
133128
this.setSupportGroup(supportGroup);
129+
this.setChatbot(chatbot);
134130
this.setOrganizations(orgs);
135131
this.setGroupMe(groupMe);
136132
const myAuthData = osparc.auth.Data.getInstance();

0 commit comments

Comments
 (0)