File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
services/static-webserver/client/source/class/osparc Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ qx.Class.define("osparc.dashboard.CardBase", {
183183 } ) ;
184184 // once the groups were removed, the remaining group ids are users' primary groups ids
185185 const usersStore = osparc . store . Users . getInstance ( ) ;
186- const myGroupId = osparc . auth . Data . getInstance ( ) . getGroupId ( ) ;
186+ const myGroupId = groupsStore . getMyGroupId ( ) ;
187187 for ( let i = 0 ; i < gids . length ; i ++ ) {
188188 const gid = gids [ i ] ;
189189 if ( myGroupId !== gid ) {
@@ -194,8 +194,9 @@ qx.Class.define("osparc.dashboard.CardBase", {
194194 }
195195 }
196196
197+ const canIWrite = osparc . data . model . Study . canIWrite ( accessRights ) ;
197198 if ( sharedGrps . length === 0 ) {
198- if ( osparc . data . model . Study . canIWrite ( accessRights ) ) {
199+ if ( canIWrite ) {
199200 shareIcon . set ( {
200201 toolTipText : qx . locale . Manager . tr ( "Share" )
201202 } ) ;
Original file line number Diff line number Diff line change @@ -274,21 +274,19 @@ qx.Class.define("osparc.data.model.Study", {
274274 } ,
275275
276276 canIWrite : function ( studyAccessRights ) {
277- const myGroupId = osparc . auth . Data . getInstance ( ) . getGroupId ( ) ;
278277 const groupsStore = osparc . store . Groups . getInstance ( ) ;
279278 const orgIDs = groupsStore . getOrganizationIds ( ) ;
280- orgIDs . push ( myGroupId ) ;
279+ orgIDs . push ( groupsStore . getMyGroupId ( ) ) ;
281280 if ( orgIDs . length ) {
282281 return osparc . share . CollaboratorsStudy . canGroupsWrite ( studyAccessRights , ( orgIDs ) ) ;
283282 }
284283 return false ;
285284 } ,
286285
287286 canIDelete : function ( studyAccessRights ) {
288- const myGroupId = osparc . auth . Data . getInstance ( ) . getGroupId ( ) ;
289287 const groupsStore = osparc . store . Groups . getInstance ( ) ;
290288 const orgIDs = groupsStore . getOrganizationIds ( ) ;
291- orgIDs . push ( myGroupId ) ;
289+ orgIDs . push ( groupsStore . getMyGroupId ( ) ) ;
292290 if ( orgIDs . length ) {
293291 return osparc . share . CollaboratorsStudy . canGroupsDelete ( studyAccessRights , ( orgIDs ) ) ;
294292 }
You can’t perform that action at this time.
0 commit comments