Issue
- I am using Documents and Media to upload files.
- Some of the documents must be restricted for a single user.
- The user must access a list of documents that only he/she is able to see.
Environment
- Liferay DXP 7.2+
Resolution
By default, Liferay DXP has a role-based permissions system. Administrators can let users collaborate on files by assigning the appropriate file permissions to a Role, and then assigning users to that Role. This is not very practical for this use case, because if you want to share a file with one other user only, it’s not practical for an Administrator to create and manage a Role for that user.
There are 2 ways to go about this issue:
- It is possible to share certain files with another user. In this scenario, the Administrator would upload the file to Documents and Media with the restriction that only Administrators can view the file (maybe even a separate folder can be created for keeping those files). Then, the Administrator can decide to share the file with the specific user. For more information, please visit the following article: Sharing Files
- Another approach would be using the specific user's personal Site. By default, Liferay generates a personal Site for every User. Each Site includes two page sets: My Profile (public) and My Dashboard (private). Each User is the sole member of their personal Site and can use it to display and manage their content. You can access the User's private pages (http://localhost:8080/user/{username}) as an Administrator and place a Documents and Media widget on the page. Then you can upload a document using this widget with the default "User" permission. However, be aware that if you place another Documents and Media widget on the user's My Profile page (which is public and accessible by others), the document will be accessible to others from there. If desired, you can disable or customize personal Sites using portal properties. Please refer to the following article for more details: Personal Sites