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

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

krutik_jayswal
Elite Collaborator
Elite Collaborator

First which you need to do is creating an marker aspect.Apply it to the folder on which you want to disable the download action.There are multiple ways for adding an aspect.

For disabling the download action on the children/files which are inside the folder we have 2 approach.

First one is, 

Creating new custom evaluator in which you need to check whether the parent folder has the marker aspect or not.If it has you can disable the download action by returning fals evalue in custome java evaluator.

Below link will help you in creating an custom java evaluator.

Evaluators | Alfresco Documentation 

Second one it.

Create a behavior, which will get called when you add in aspect in a folder.In this behavior write the logic that when you add aspect in folder it will also apply that aspect to all childrens.

Create one more behavior , when you upload or create a content inside that folder , it will check whether the parent folder has an aspect or not, if it has it will apply it to the new content as well.

Below links will help you in creating policies.

Implementing Custom Behaviors in Alfresco | ECMArchitect | Alfresco Developer Tutorials 

Behaviours / Policies | Alfresco Documentation 

After creating policies use hasAspct evaluator which is mentioned in below link.For creating hasAspect evaluator you do not need to do any java coding.

Predefined Evaluators | Alfresco Documentation