Disable Download action on a folder

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Established Member

Disable Download action on a folder

Jump to solution

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 Solution

Accepted Solutions
Highlighted
Established Member
12 Replies
Highlighted
Member II

Re: Disable Download action on a folder

Jump to solution

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.

Highlighted
Senior Member

Re: Disable Download action on a folder

Jump to solution

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 .

Highlighted
Established Member

Re: Disable Download action on a folder

Jump to solution

Wouldn't this disable Download Action on all of the folders.. I want to disable Download on a particular folder.

Highlighted
Established Member

Re: Disable Download action on a folder

Jump to solution

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.

Highlighted
Member II

Re: Disable Download action on a folder

Jump to solution

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

Highlighted
Established Member

Re: Disable Download action on a folder

Jump to solution

Hi ‌,

yes ..

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

Highlighted
Member II

Re: Disable Download action on a folder

Jump to solution

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 

Highlighted
Established Member

Re: Disable Download action on a folder

Jump to solution

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?
Highlighted
Established Member

Re: Disable Download action on a folder

Jump to solution

‌ could you guide me through it.