cancel
Showing results for 
Search instead for 
Did you mean: 

Limit number of downloads

edgy
Champ in-the-making
Champ in-the-making
Hi there!

I hope that I am in the right place here to post this question:

Is there a way how I can limit the number of downloads per user or even better per role? Let's say I want to limit the number of documents that a user can download within a given period of time (for example: consumer role may download 10 documents per day only). Is this possible at all?

If there is a solution for that then my next question would be if it is possible to trigger an email once this download quota has been reached.

I would be very glad if someone has an idea on how to solve these to issues. I have tried searching the forums and also Google of course, but without success.

Thanks in advance!


//edgy
Today's subliminal message is:
1 REPLY 1

openpj
Elite Collaborator
Elite Collaborator
You could implement a policy component that allows you to define a new business logic that could be triggered at low level in any Alfresco services.

Each service in Alfresco is based on policies that are similar to events and you can inject your behaviour, or logic, (using the Java API or the Javascript API) inside one of these specific business "moments". The service that allows you to implement your case is the ContentService.

More information about policy components are described at the following address:
http://wiki.alfresco.com/wiki/Policy_Component

You also can take a look at the sample "SDK CustomAspect" that you find in the Alfresco SDK, that shows how to implement a custom behaviour using policies.

For this specific case you could add a new custom behaviour (implemented using a policy component) that starts to count all the user request, when the counter is equal to the limit, then you want to not serve the download request.

The download request could be matched with one of the policies of the ContentService of Alfresco that is OnContentReadPolicy defined in the interface ContentServicePolicies.

Hope this helps  :wink: