Legacy Knowledge Base
Published Jun. 30, 2025

I want to restrict access to certain documents to a single user

Written By

Tímea Bihari

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

While we make every effort to ensure this Knowledge Base is accurate, itmay not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with anyfeedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

Before using any information from this article, independently verify itssuitability for your situation and project.

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:

  1. 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
  2. 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

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base