diff --git a/services/static-webserver/client/source/class/osparc/data/model/Group.js b/services/static-webserver/client/source/class/osparc/data/model/Group.js index 3153c95e0dc..b5e1db692e0 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/Group.js +++ b/services/static-webserver/client/source/class/osparc/data/model/Group.js @@ -28,11 +28,17 @@ qx.Class.define("osparc.data.model.Group", { construct: function(groupData) { this.base(arguments); + const defaultAccessRights = { + "read": false, + "write": false, + "delete": false, + }; + this.set({ groupId: groupData.gid, label: groupData.label, description: groupData.description, - accessRights: groupData.accessRights, + accessRights: groupData.accessRights || defaultAccessRights, thumbnail: groupData.thumbnail, groupMembers: {}, }); @@ -82,7 +88,7 @@ qx.Class.define("osparc.data.model.Group", { }, groupType: { - check: ["me", "organization", "support", "productEveryone", "everyone"], + check: ["me", "organization", "support", "chatbot", "productEveryone", "everyone"], nullable: false, init: null, }, diff --git a/services/static-webserver/client/source/class/osparc/store/Groups.js b/services/static-webserver/client/source/class/osparc/store/Groups.js index eb9d5a000f1..e8fff566d02 100644 --- a/services/static-webserver/client/source/class/osparc/store/Groups.js +++ b/services/static-webserver/client/source/class/osparc/store/Groups.js @@ -106,16 +106,11 @@ qx.Class.define("osparc.store.Groups", { const productEveryoneGroup = this.__addToGroupsCache(resp["product"], "productEveryone"); let supportGroup = null; if ("support" in resp && resp["support"]) { - resp["support"]["accessRights"] = { - "read": false, - "write": false, - "delete": false, - }; supportGroup = this.__addToGroupsCache(resp["support"], "support"); } + let chatbot = null; if ("chatbot" in resp && resp["chatbot"]) { - const chatbot = new osparc.data.model.Group(resp["chatbot"]); - this.setChatbot(chatbot); + chatbot = this.__addToGroupsCache(resp["chatbot"], "chatbot"); } const groupMe = this.__addToGroupsCache(resp["me"], "me"); const orgs = {}; @@ -131,6 +126,7 @@ qx.Class.define("osparc.store.Groups", { this.setEveryoneGroup(everyoneGroup); this.setEveryoneProductGroup(productEveryoneGroup); this.setSupportGroup(supportGroup); + this.setChatbot(chatbot); this.setOrganizations(orgs); this.setGroupMe(groupMe); const myAuthData = osparc.auth.Data.getInstance();