File tree Expand file tree Collapse file tree 6 files changed +19
-14
lines changed
services/static-webserver/client/source/class/osparc Expand file tree Collapse file tree 6 files changed +19
-14
lines changed Original file line number Diff line number Diff line change @@ -640,6 +640,9 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
640640 if ( osparc . utils . Resources . isStudyLike ( this . __resourceData ) && ! osparc . data . model . Study . canIWrite ( this . __resourceData [ "accessRights" ] ) ) {
641641 return ;
642642 }
643+ if ( osparc . utils . Resources . isService ( this . __resourceData ) && ! osparc . data . model . Service . canIWrite ( this . __resourceData [ "accessRights" ] ) ) {
644+ return ;
645+ }
643646
644647 const id = "Permissions" ;
645648 const title = this . tr ( "Sharing" ) ;
@@ -702,7 +705,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
702705 let classifiers = null ;
703706 if (
704707 ( osparc . utils . Resources . isStudy ( resourceData ) || osparc . utils . Resources . isTemplate ( resourceData ) ) && osparc . data . model . Study . canIWrite ( resourceData [ "accessRights" ] ) ||
705- osparc . utils . Resources . isService ( resourceData ) && osparc . service . Utils . canIWrite ( resourceData [ "accessRights" ] )
708+ osparc . utils . Resources . isService ( resourceData ) && osparc . data . model . Service . canIWrite ( resourceData [ "accessRights" ] )
706709 ) {
707710 classifiers = new osparc . metadata . ClassifiersEditor ( resourceData ) ;
708711 classifiers . addListener ( "updateClassifiers" , e => {
Original file line number Diff line number Diff line change @@ -161,4 +161,13 @@ qx.Class.define("osparc.data.model.Service", {
161161 nullable : false
162162 } ,
163163 } ,
164+
165+ statics : {
166+ canIWrite : function ( serviceAccessRights ) {
167+ const groupsStore = osparc . store . Groups . getInstance ( ) ;
168+ const orgIDs = groupsStore . getOrganizationIds ( ) ;
169+ orgIDs . push ( groupsStore . getMyGroupId ( ) ) ;
170+ return osparc . share . CollaboratorsService . canGroupsWrite ( serviceAccessRights , orgIDs ) ;
171+ } ,
172+ } ,
164173} ) ;
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ qx.Class.define("osparc.info.ServiceLarge", {
110110
111111 if (
112112 this . getService ( ) [ "descriptionUi" ] &&
113- ! osparc . service . Utils . canIWrite ( this . getService ( ) [ "accessRights" ] )
113+ ! osparc . data . model . Service . canIWrite ( this . getService ( ) [ "accessRights" ] )
114114 ) {
115115 // In case of service instance, show also the copy Id buttons too
116116 const buttonsLayout = new qx . ui . container . Composite ( new qx . ui . layout . HBox ( 10 ) ) ;
@@ -177,7 +177,7 @@ qx.Class.define("osparc.info.ServiceLarge", {
177177 alignY : "middle"
178178 } ) ) ;
179179 layout . add ( view ) ;
180- if ( osparc . service . Utils . canIWrite ( this . getService ( ) [ "accessRights" ] ) ) {
180+ if ( osparc . data . model . Service . canIWrite ( this . getService ( ) [ "accessRights" ] ) ) {
181181 const editBtn = osparc . utils . Utils . getEditButton ( ) ;
182182 editBtn . addListener ( "execute" , ( ) => cb . call ( this ) , this ) ;
183183 layout . add ( editBtn ) ;
@@ -221,7 +221,7 @@ qx.Class.define("osparc.info.ServiceLarge", {
221221 } ,
222222
223223 __infoElements : function ( ) {
224- const canIWrite = osparc . service . Utils . canIWrite ( this . getService ( ) [ "accessRights" ] ) ;
224+ const canIWrite = osparc . data . model . Service . canIWrite ( this . getService ( ) [ "accessRights" ] ) ;
225225
226226 const infoLayout = {
227227 "THUMBNAIL" : {
Original file line number Diff line number Diff line change @@ -484,7 +484,7 @@ qx.Class.define("osparc.metadata.QualityEditor", {
484484 const myGid = osparc . auth . Data . getInstance ( ) . getGroupId ( ) ;
485485 if ( myGid ) {
486486 if ( osparc . utils . Resources . isService ( this . __resourceData ) ) {
487- return osparc . service . Utils . canIWrite ( this . __resourceData [ "accessRights" ] ) ;
487+ return osparc . data . model . Service . canIWrite ( this . __resourceData [ "accessRights" ] ) ;
488488 }
489489 return osparc . data . model . Study . canIWrite ( this . __resourceData [ "accessRights" ] ) ;
490490 }
Original file line number Diff line number Diff line change @@ -140,13 +140,6 @@ qx.Class.define("osparc.service.Utils", {
140140 return "" ;
141141 } ,
142142
143- canIWrite : function ( serviceAccessRights ) {
144- const groupsStore = osparc . store . Groups . getInstance ( ) ;
145- const orgIDs = groupsStore . getOrganizationIds ( ) ;
146- orgIDs . push ( groupsStore . getMyGroupId ( ) ) ;
147- return osparc . share . CollaboratorsService . canGroupsWrite ( serviceAccessRights , orgIDs ) ;
148- } ,
149-
150143 DEPRECATED_SERVICE_TEXT : qx . locale . Manager . tr ( "Service deprecated" ) ,
151144 DEPRECATED_DYNAMIC_INSTRUCTIONS : qx . locale . Manager . tr ( "Please go back to the dashboard and Update the Service or download its data and upload it to an updated version" ) ,
152145 DEPRECATED_COMPUTATIONAL_INSTRUCTIONS : qx . locale . Manager . tr ( "Please instantiate an updated version" ) ,
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ qx.Class.define("osparc.share.Collaborators", {
202202 canIShare = osparc . data . model . Function . canIWrite ( this . _serializedDataCopy [ "accessRights" ] ) ;
203203 break ;
204204 case "service" :
205- canIShare = osparc . service . Utils . canIWrite ( this . _serializedDataCopy [ "accessRights" ] ) ;
205+ canIShare = osparc . data . model . Service . canIWrite ( this . _serializedDataCopy [ "accessRights" ] ) ;
206206 break ;
207207 case "workspace" :
208208 canIShare = osparc . share . CollaboratorsWorkspace . canIDelete ( this . _serializedDataCopy [ "myAccessRights" ] ) ;
@@ -231,7 +231,7 @@ qx.Class.define("osparc.share.Collaborators", {
231231 fullOptions = osparc . data . model . Function . canIWrite ( this . _serializedDataCopy [ "accessRights" ] ) ;
232232 break ;
233233 case "service" :
234- fullOptions = osparc . service . Utils . canIWrite ( this . _serializedDataCopy [ "accessRights" ] ) ;
234+ fullOptions = osparc . data . model . Service . canIWrite ( this . _serializedDataCopy [ "accessRights" ] ) ;
235235 break ;
236236 case "workspace" :
237237 fullOptions = osparc . share . CollaboratorsWorkspace . canIDelete ( this . _serializedDataCopy [ "myAccessRights" ] ) ;
You can’t perform that action at this time.
0 commit comments