Shikhar Srivastava
Shikhar Srivastava

Reputation: 149

How to limit the document storage for an organization in Liferay?

In Liferay Portal 6.2, I have created an organization with a site where users of that organization can upload and share documents & media. I would like to limit the amount of storage space each organization is allowed to allocate for its documents.

For example, say Company A is an organization. I want only 512 MB alloted to the organization for documents & media. When the users of Company A uploads files and the limit of 512 MB is reached, no further documents can be uploaded.

Can this be done in Liferay Portal?

Upvotes: 1

Views: 186

Answers (2)

Marco Mercuri
Marco Mercuri

Reputation: 1127

You can create a Model Listener in which every time a new document is uploaded you store its weight in an organization document weight counter on the DB (you can create a new entity with its own service). If counter + new document's weight > 512 MB you can stop the upload.

Obviously, you should manage update and delete of documents too.

Upvotes: 3

Jelle
Jelle

Reputation: 586

I don't think this can be done with a Liferay out of the box installation. However it should be an easy customization.

An other option is to limit the space for certain folders in the Documents and Media Library at an OS level. But the customization offers a way more flexible solution.

Upvotes: 1

Related Questions