@@ -141,13 +141,29 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
141141 __classifiersPage : null ,
142142 __qualityPage : null ,
143143
144- __addOpenButton : function ( page ) {
144+ __addToolbarButtons : function ( page ) {
145145 const resourceData = this . __resourceData ;
146146
147147 const toolbar = this . self ( ) . createToolbar ( ) ;
148148 page . addToHeader ( toolbar ) ;
149149
150- if ( [ "study" , "template" ] . includes ( this . __resourceData [ "resourceType" ] ) ) {
150+ if ( [ "study" , "template" , "tutorial" ] . includes ( resourceData [ "resourceType" ] ) ) {
151+ const cantReadServices = osparc . study . Utils . getCantReadServices ( resourceData [ "services" ] ) ;
152+ if ( cantReadServices . length ) {
153+ const requestAccessButton = new qx . ui . form . Button ( this . tr ( "Request Apps Access" ) ) ;
154+ osparc . dashboard . resources . pages . BasePage . decorateHeaderButton ( requestAccessButton ) ;
155+ requestAccessButton . set ( {
156+ minWidth : 170 ,
157+ maxWidth : 170 ,
158+ } ) ;
159+ requestAccessButton . addListener ( "execute" , ( ) => {
160+ osparc . share . RequestServiceAccess . openRequestAccess ( cantReadServices ) ;
161+ } ) ;
162+ toolbar . add ( requestAccessButton ) ;
163+ }
164+ }
165+
166+ if ( this . __resourceData [ "resourceType" ] === "study" ) {
151167 const payDebtButton = new qx . ui . form . Button ( this . tr ( "Credits required" ) ) ;
152168 page . payDebtButton = payDebtButton ;
153169 osparc . dashboard . resources . pages . BasePage . decorateHeaderButton ( payDebtButton ) ;
@@ -405,7 +421,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
405421 const title = this . tr ( "Overview" ) ;
406422 const iconSrc = "@FontAwesome5Solid/info/22" ;
407423 const page = this . __infoPage = new osparc . dashboard . resources . pages . BasePage ( title , iconSrc , id ) ;
408- this . __addOpenButton ( page ) ;
424+ this . __addToolbarButtons ( page ) ;
409425
410426 const lazyLoadContent = ( ) => {
411427 const resourceData = this . __resourceData ;
@@ -446,7 +462,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
446462 const title = this . tr ( "Billing Settings" ) ;
447463 const iconSrc = "@FontAwesome5Solid/cogs/22" ;
448464 const page = this . __billingSettings = new osparc . dashboard . resources . pages . BasePage ( title , iconSrc , id ) ;
449- this . __addOpenButton ( page ) ;
465+ this . __addToolbarButtons ( page ) ;
450466
451467 if ( resourceData [ "resourceType" ] === "study" ) {
452468 const canBeOpened = osparc . study . Utils . canShowBillingOptions ( resourceData ) ;
@@ -473,7 +489,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
473489 const title = this . tr ( "Tiers" ) ;
474490 const iconSrc = "@FontAwesome5Solid/server/22" ;
475491 const page = new osparc . dashboard . resources . pages . BasePage ( title , iconSrc , id ) ;
476- this . __addOpenButton ( page ) ;
492+ this . __addToolbarButtons ( page ) ;
477493
478494 const lazyLoadContent = ( ) => {
479495 const pricingUnitsList = new osparc . service . PricingUnitsList ( resourceData ) ;
@@ -502,7 +518,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
502518 const title = this . tr ( "Pipeline View" ) ;
503519 const iconSrc = "@FontAwesome5Solid/eye/22" ;
504520 const page = new osparc . dashboard . resources . pages . BasePage ( title , iconSrc , id ) ;
505- this . __addOpenButton ( page ) ;
521+ this . __addToolbarButtons ( page ) ;
506522
507523 const studyData = this . __resourceData ;
508524 const enabled = osparc . study . Utils . canShowPreview ( studyData ) ;
@@ -528,7 +544,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
528544 const title = this . tr ( "Conversations" ) ;
529545 const iconSrc = "@FontAwesome5Solid/comments/22" ;
530546 const page = new osparc . dashboard . resources . pages . BasePage ( title , iconSrc , id ) ;
531- this . __addOpenButton ( page ) ;
547+ this . __addToolbarButtons ( page ) ;
532548
533549 const lazyLoadContent = ( ) => {
534550 const conversations = new osparc . study . Conversations ( resourceData ) ;
@@ -544,7 +560,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
544560 const title = this . tr ( "Sharing" ) ;
545561 const iconSrc = "@FontAwesome5Solid/share-alt/22" ;
546562 const page = this . __permissionsPage = new osparc . dashboard . resources . pages . BasePage ( title , iconSrc , id ) ;
547- this . __addOpenButton ( page ) ;
563+ this . __addToolbarButtons ( page ) ;
548564
549565 const lazyLoadContent = ( ) => {
550566 const resourceData = this . __resourceData ;
@@ -587,7 +603,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
587603 const title = this . tr ( "Classifiers" ) ;
588604 const iconSrc = "@FontAwesome5Solid/search/22" ;
589605 const page = this . __classifiersPage = new osparc . dashboard . resources . pages . BasePage ( title , iconSrc , id ) ;
590- this . __addOpenButton ( page ) ;
606+ this . __addToolbarButtons ( page ) ;
591607
592608 const lazyLoadContent = ( ) => {
593609 const resourceData = this . __resourceData ;
@@ -625,7 +641,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
625641 const title = this . tr ( "Quality" ) ;
626642 const iconSrc = "@FontAwesome5Solid/star-half/22" ;
627643 const page = this . __qualityPage = new osparc . dashboard . resources . pages . BasePage ( title , iconSrc , id ) ;
628- this . __addOpenButton ( page ) ;
644+ this . __addToolbarButtons ( page ) ;
629645
630646 const lazyLoadContent = ( ) => {
631647 const qualityEditor = new osparc . metadata . QualityEditor ( resourceData ) ;
@@ -655,7 +671,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
655671 const title = this . tr ( "Tags" ) ;
656672 const iconSrc = "@FontAwesome5Solid/tags/22" ;
657673 const page = this . __tagsPage = new osparc . dashboard . resources . pages . BasePage ( title , iconSrc , id ) ;
658- this . __addOpenButton ( page ) ;
674+ this . __addToolbarButtons ( page ) ;
659675
660676 const lazyLoadContent = ( ) => {
661677 const tagManager = new osparc . form . tag . TagManager ( resourceData ) ;
@@ -681,7 +697,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
681697 const title = this . tr ( "Services Updates" ) ;
682698 const iconSrc = "@MaterialIcons/update/24" ;
683699 const page = this . __servicesUpdatePage = new osparc . dashboard . resources . pages . BasePage ( title , iconSrc , id ) ;
684- this . __addOpenButton ( page ) ;
700+ this . __addToolbarButtons ( page ) ;
685701
686702 const studyData = this . __resourceData ;
687703 const enabled = osparc . study . Utils . canShowServiceUpdates ( studyData ) ;
@@ -713,7 +729,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
713729 const title = this . tr ( "Boot Options" ) ;
714730 const iconSrc = "@FontAwesome5Solid/play-circle/22" ;
715731 const page = new osparc . dashboard . resources . pages . BasePage ( title , iconSrc , id ) ;
716- this . __addOpenButton ( page ) ;
732+ this . __addToolbarButtons ( page ) ;
717733
718734 const studyData = this . __resourceData ;
719735 const enabled = osparc . study . Utils . canShowServiceBootOptions ( studyData ) ;
@@ -829,7 +845,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
829845 } ,
830846
831847 __getCreateFunctionsPage : function ( ) {
832- if ( osparc . utils . DisabledPlugins . isFunctionsDisabled ( ) ) {
848+ if ( ! osparc . data . Permissions . getInstance ( ) . checkFunctionPermissions ( "writeFunctions" ) ) {
833849 return null ;
834850 }
835851
0 commit comments