Skip to content

Commit 5b795a1

Browse files
committed
shareProjectWithSupport
1 parent da28e7a commit 5b795a1

File tree

1 file changed

+14
-1
lines changed
  • services/static-webserver/client/source/class/osparc/support

1 file changed

+14
-1
lines changed

services/static-webserver/client/source/class/osparc/support/Conversation.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,20 @@ qx.Class.define("osparc.support.Conversation", {
179179
},
180180

181181
__shareProjectWithSupport: function(e) {
182-
console.log("Share project with support: ", e.getData());
182+
const share = e.getData();
183+
const supportGroupId = osparc.store.Products.getInstance().getSupportGroupId();
184+
const projectId = this.getConversation().getContextProjectId();
185+
osparc.store.Study.getInstance().getOne(projectId)
186+
.then(studyData => {
187+
if (share) {
188+
const newCollaborators = {
189+
[supportGroupId]: osparc.data.Roles.STUDY["write"].accessRights
190+
};
191+
osparc.store.Study.getInstance().addCollaborators(studyData, newCollaborators)
192+
} else {
193+
osparc.store.Study.getInstance().removeCollaborator(studyData, supportGroupId);
194+
}
195+
});
183196
},
184197

185198
__reloadMessages: function(removeMessages = true) {

0 commit comments

Comments
 (0)