Skip to content

Commit

Permalink
🐛 Bugfix: Let users make Services Public (#3997)
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz authored Mar 20, 2023
1 parent bfff087 commit ef19c77
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ qx.Class.define("osparc.component.share.NewCollaboratorsManager", {
},

__reloadCollaborators: function() {
osparc.store.Store.getInstance().getPotentialCollaborators()
let includeEveryone = false;
if (this.__resourceData["resourceType"] === "service") {
includeEveryone = true;
} else {
includeEveryone = osparc.data.Permissions.getInstance().canDo("study.everyone.share");
}
osparc.store.Store.getInstance().getPotentialCollaborators(includeEveryone)
.then(potentialCollaborators => {
this.__visibleCollaborators = potentialCollaborators;
this.__addCollaborators();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,12 +500,13 @@ qx.Class.define("osparc.store.Store", {
});
},

getPotentialCollaborators: function() {
getPotentialCollaborators: function(includeGlobalEveryone = false) {
return new Promise((resolve, reject) => {
const promises = [];
promises.push(this.getGroupsOrganizations());
promises.push(this.getVisibleMembers());
promises.push(this.getProductEveryone());
promises.push(this.getGroupEveryone());
Promise.all(promises)
.then(values => {
const orgs = values[0]; // array
Expand All @@ -526,6 +527,11 @@ qx.Class.define("osparc.store.Store", {
productEveryone["collabType"] = 0;
potentialCollaborators[productEveryone["gid"]] = productEveryone;
}
const groupEveryone = values[3];
if (includeGlobalEveryone && groupEveryone) {
groupEveryone["collabType"] = 0;
potentialCollaborators[groupEveryone["gid"]] = groupEveryone;
}
resolve(potentialCollaborators);
})
.catch(err => {
Expand Down

0 comments on commit ef19c77

Please sign in to comment.