diff --git a/services/static-webserver/client/source/class/osparc/component/share/NewCollaboratorsManager.js b/services/static-webserver/client/source/class/osparc/component/share/NewCollaboratorsManager.js index b04d7d612d4..8797e070dda 100644 --- a/services/static-webserver/client/source/class/osparc/component/share/NewCollaboratorsManager.js +++ b/services/static-webserver/client/source/class/osparc/component/share/NewCollaboratorsManager.js @@ -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(); diff --git a/services/static-webserver/client/source/class/osparc/store/Store.js b/services/static-webserver/client/source/class/osparc/store/Store.js index 5de2bd7dfda..2c78f7637a0 100644 --- a/services/static-webserver/client/source/class/osparc/store/Store.js +++ b/services/static-webserver/client/source/class/osparc/store/Store.js @@ -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 @@ -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 => {