cancel
Showing results for 
Search instead for 
Did you mean: 

Enable/Disable Share create content menu option

stephenl
Champ on-the-rise
Champ on-the-rise

Hi,

ReSmiley Frustratedhare-custom-config.xml

I'm trying to find a way to dynamically enable/disable a "create content" menu option in the Share repository task bar. Hopefully I can create a user group that can allow use of this command, if the user isn't part of the group then the option is not displayed.

This is a custom content type that has already been defined & is in use successfully so everything is already in place, all I need is some way to disable it if required.

I assumed that using an evaluator in the same way as with actions would suffice but they don't seem to be triggered for the menu items.

<config evaluator="string-compare" condition="DocumentLibrary">
   <create-content>
      <content id="plain-text" mimetype="text/plain" label="some text" itemid="model:customtype" icon="icon">
         <evaluator>evaluator.never.gets.fired.it.seems</evaluator>
      </content>
   </create-content>
   <types>
      <type name="cm:content">
         <subtype name="model:customtype" />
      </type>
      <type name="cm:folder">
      </type>
      </types>
</config>

Any pointers would be appreciated.

1 ACCEPTED ANSWER

afaust
Legendary Innovator
Legendary Innovator

You could simply override the create-content group as empty in the default share-config-custom.xml and then have a Surf Extension module add in the elements that you want. A Surf extension module can be configured with an evaluator based on group membership of the current user, and that way you can group all create-content items under one evaluator. I do not believe that the create-content elements themselves even support the evaluator element, since they are never dynamically processed like e.g. metadata templates and actions are.

View answer in original post

1 REPLY 1

afaust
Legendary Innovator
Legendary Innovator

You could simply override the create-content group as empty in the default share-config-custom.xml and then have a Surf Extension module add in the elements that you want. A Surf extension module can be configured with an evaluator based on group membership of the current user, and that way you can group all create-content items under one evaluator. I do not believe that the create-content elements themselves even support the evaluator element, since they are never dynamically processed like e.g. metadata templates and actions are.