@@ -194,13 +194,27 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
194194 appearance : "menu-wider" ,
195195 } ) ;
196196
197- const templatesButton = this . self ( ) . createMenuButton ( "@FontAwesome5Solid/copy/16" , this . tr ( "Tutorials..." ) ) ;
198- templatesButton . addListener ( "execute" , ( ) => this . fireDataEvent ( "changeTab" , "templatesTab" ) , this ) ;
199- moreMenu . add ( templatesButton ) ;
197+ const permissions = osparc . data . Permissions . getInstance ( ) ;
198+ if ( permissions . canDo ( "dashboard.templates.read" ) ) {
199+ const templatesButton = this . self ( ) . createMenuButton ( "@FontAwesome5Solid/copy/16" , this . tr ( "Tutorials..." ) ) ;
200+ templatesButton . addListener ( "execute" , ( ) => this . fireDataEvent ( "changeTab" , "templatesTab" ) , this ) ;
201+ moreMenu . add ( templatesButton ) ;
202+
203+ const hypertoolsButton = this . self ( ) . createMenuButton ( "@FontAwesome5Solid/copy/16" , this . tr ( "Hypertools..." ) ) ;
204+ hypertoolsButton . addListener ( "execute" , ( ) => this . fireDataEvent ( "changeTab" , "hypertoolsTab" ) , this ) ;
205+ const hypertools = osparc . store . Templates . getInstance ( ) . getTemplatesByType ( osparc . data . model . StudyUI . HYPERTOOL_TYPE ) ;
206+ if ( hypertools . length ) {
207+ moreMenu . add ( hypertoolsButton ) ;
208+ }
209+ }
210+
211+ if ( permissions . canDo ( "dashboard.services.read" ) ) {
212+ const servicesButton = this . self ( ) . createMenuButton ( "@FontAwesome5Solid/cog/16" , this . tr ( "Services..." ) ) ;
213+ servicesButton . addListener ( "execute" , ( ) => this . fireDataEvent ( "changeTab" , "servicesTab" ) , this ) ;
214+ moreMenu . add ( servicesButton ) ;
215+ }
200216
201- const servicesButton = this . self ( ) . createMenuButton ( "@FontAwesome5Solid/cog/16" , this . tr ( "Services..." ) ) ;
202- servicesButton . addListener ( "execute" , ( ) => this . fireDataEvent ( "changeTab" , "servicesTab" ) , this ) ;
203- moreMenu . add ( servicesButton ) ;
217+ moreMenuButton . setVisibility ( moreMenu . getChildren ( ) . length ? "visible" : "excluded" ) ;
204218
205219 moreMenuButton . setMenu ( moreMenu ) ;
206220 } ,
0 commit comments