cancel
Showing results for 
Search instead for 
Did you mean: 

Disable custom extension module for consumer users

raghav_bhardwaj
Champ on-the-rise
Champ on-the-rise
Hi I want to disable custom extension module for consumer users . Is it possible to hide it only for consumers.


any place in above code where i can put some entry to do this????
3 REPLIES 3

niketapatel
Star Contributor
Star Contributor
You can add module level evaluator as below


<extension>
   <modules>
      <module>
        <id>Hide add external user</id>
        <evaluator type="site.module.evaluator">
         <params>
            <sites>.*</sites>
            <groups>SiteConsumer</groups>
         </params>
        </evaluator>   
        <auto-deploy>true</auto-deploy>
         <components>
            <component>
              <region-id>addemail</region-id>
              <source-id>invite</source-id>
              <scope>template</scope>
              <sub-components>
                <sub-component id="default">
                  <evaluations>
                    <evaluation id="guaranteedToHide">
                       <render>false</render>
                    </evaluation>
                  </evaluations>
                 </sub-component>
              </sub-components>
            </component>
          </components>
      </module>
   </modules>
</extension>  

steven_okennedy
Star Contributor
Star Contributor
Hi raghav,

You probably have the wrong forum for this, as this forum is for end user Share questions, rather than customisations.

In any case, if you want behaviour like this you need to design and build it into your customisation so that your extension doesn't have any impact on users with the consumer role.  Doing this will depend completely on what your extension is doing (e.g. is it Share only, or also contain Alfresco extension elements like behaviours or actions etc). 

E.g. if your extension is a just a basic Surf Extension module you can use techniques like these http://docs.alfresco.com/5.0/tasks/dev-extensions-share-tutorials-subcomponent-evals.html to define (or resuse) evalustors that determine when the extension comes into effect.

Otherwise you can build the logic into your extension itself to determine whether to show it or not using techniques similar to those used by the evalutor - just bear in mind performance when you are doing this if you need to do calls back to Alfresco (you don't want want each item in a document library making a call to Alfresco to determine whether or not to show an action for example)

Regards

Steven

Thanks Niketa,

but after implementing your code iam not able to see the extension module either for admin or non admin users. Please assist me to accomplish my task