I have started to work on a legacy project based on Liferay 7. My project is based on Java and Spring.
As a user with Content Manager role I am able to enter “Documents and Media” panel and download any media. As shown in this image from official Liferay documentation:
In my application I have users with roles which much less rights which cannot see the panel for “Documents and Media”. I am able to change permissions of those documents to allow or disallow them to view this documents from the portal itself which works fine.
The problem is if someone somehow will guess the real path to this document, for example:
https://example.org/documents/11111/3223344/mydocument.pdf
Then although he does not have the permissions to view it through the portal she/he will be able to download it with the direct link.
Is there any way to restrict downloading documents directly from the portal for users which do not have Content-manager role?