cancel
Showing results for 
Search instead for 
Did you mean: 

Disable Download action on a folder

sakshik
Star Contributor
Star Contributor

Hello,

I have read posts about how to disable download actions for a consumer or at all. But, I need to disable Download action on a folder. 

Any suggestions?

1 ACCEPTED ANSWER
12 REPLIES 12

ashwin_mor
Champ in-the-making
Champ in-the-making

This can be done share document library XML file. It has an entry for folder and document actions. You can remove or add specific evaluator for folder action.

Hi ashwin.mor _‌ 

 I want to disable Download on a particular folder such that no document on that folder is allowed to be downloaded. Could you elaborate on your answer.

ashwin_mor
Champ in-the-making
Champ in-the-making

Hi Sakshi,

Evaluators can come in handy for your use case. You need a way to identify folders for which you want to disable the action.

You can do that by using folder names as well, but I would suggest go via a aspect route. Add an aspect to the folder you want to disable the action and have a check in the evaluator.

Hope this is helpful

Hi ‌,

yes ..

and I needed information on how to create such an aspect. Could you please help with that.

ashwin_mor
Champ in-the-making
Champ in-the-making

You can create aspect as below

Creating new custom types and aspects | Alfresco Documentation 

Apply this aspect to the folders you want to restrict download action.

Use predefined evaluator to check aspect.

Predefined evaluators | Alfresco Documentation 

Hi ashwin.mor _

Thank you for the reply. I created a custom aspect type by:

Admin Tools -> Model Manager -> Create Model -> 
Prefix: dwnld
Name: DownloadAction
Inside DownloadAction ->Create Aspect
Name: download_action
Parent Aspect: None
Aspect is created.Model activated successfully. Aspect shows up in the list of available aspects: 
Now, what is the way to link this aspect to the evaluator which will disable download action?

sakshik
Star Contributor
Star Contributor

‌ could you guide me through it.

ashwin_mor
Champ in-the-making
Champ in-the-making

Hi Sakshi,

Look at

 

Use predefined evaluator to check aspect.

Predefined evaluators | Alfresco Documentation 

We now need to add a condition in share document library XML file to use the new aspect.

kalpesh_c2
Star Collaborator
Star Collaborator

Hi , Sakshi Kochhar

Add the following entry in Alfresco_Home/tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml file.

< !-- Document Library Actions config section -- >

< config evaluator="string-compare" condition="DocLibActions" >

    < !--

       Action definitions

    -- >

    < actions >

       

       < !-- Download document -- >

       < action id="document-download" type="link" label="actions.document.download" >

         

         < param name="href" >{downloadUrl}</ param >

       < !--

       Evaluator to Disable Download action when document is locked by a user

       -- >

          < evaluator negate="true" >"DOWNLOAD_CUSTOM_EVALUATOR"</ evaluator >

       </ action >

    </ actions >

</ config >

refer this documentation Creating a custom evaluator | Alfresco Documentation  to create custom evaluator .