AnsweredAssumed Answered

Hide content for a Group

Question asked by rob84 on May 29, 2015
Latest reply on Jun 1, 2015 by mitpatoliya
Hi Community

i would like to hide a create content icon in the create toolbar in myfiles. for Example google Docs.
I tried to modify the toolbar.lib.js
If i use only a User it works. If i would like to hide the Icon for a new created group (here mygroup)
an error occurred that mygroup is not defined. Does anyone know the Syntax to use Groups? or the file which i have to include? I tried <import resource="classpath:/alfresco/site-webscripts/org/alfresco/share/imports/share-header.lib.js">
but thats didn´t work, too.

A part of the Code…

   // Create content config items
   var createContentConfig = config.scoped["DocumentLibrary"]["create-content"];
   if (createContentConfig !== null)
   {
      var contentConfigs = createContentConfig.getChildren("content");
      if (contentConfigs)
      {
         var attr, content, contentConfig, paramConfigs, paramConfig, permissionsConfigs, permissionConfigs, permissionConfig;
         for (var i = 0; i < contentConfigs.size(); i++)
         {
            contentConfig = contentConfigs.get(i);
            attr = contentConfig.attributes;

// My try to hide the icon
         if (!(user.isAdmin || ismygroup(user)))
            
         if(attr.id=='google-docs') {
            continue;
         }
         
Thank you and Best wishes

Rob

Outcomes