Skip to content

Commit d86c061

Browse files
committed
fetchAccessRights
1 parent 7104733 commit d86c061

File tree

1 file changed

+14
-2
lines changed
  • services/static-webserver/client/source/class/osparc/store

1 file changed

+14
-2
lines changed

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ qx.Class.define("osparc.store.Tags", {
4545
tagsData.forEach(tagData => {
4646
const tag = this.__addToCache(tagData);
4747
tags.push(tag);
48+
this.fetchAccessRights(tag);
4849
});
4950
return tags;
5051
});
@@ -54,6 +55,10 @@ qx.Class.define("osparc.store.Tags", {
5455
return this.tagsCached;
5556
},
5657

58+
getTag: function(tagId = null) {
59+
return this.tagsCached.find(f => f.getTagId() === tagId);
60+
},
61+
5762
postTag: function(newTagData) {
5863
const params = {
5964
data: newTagData
@@ -97,8 +102,15 @@ qx.Class.define("osparc.store.Tags", {
97102
.catch(console.error);
98103
},
99104

100-
getTag: function(tagId = null) {
101-
return this.tagsCached.find(f => f.getTagId() === tagId);
105+
fetchAccessRights: function(tag) {
106+
const params = {
107+
url: {
108+
"tagId": tag.getTagId()
109+
}
110+
};
111+
osparc.data.Resources.fetch("tags", "getAccessRights", params)
112+
.then(accessRights => tag.setAccessRights(accessRights))
113+
.catch(err => console.error(err));
102114
},
103115

104116
__addToCache: function(tagData) {

0 commit comments

Comments
 (0)