Hi. How can we help?

Setup a document area for logged-in users

Last updated: 28 September 2022

Use case

  • Registered users can only upload documents to a specific category and not be allowed to see other categories and documents.
  • Administrators can see and manage all the documents from the front-end.

Solution

DOCman's menu items have the option to Only show own documents. This only shows documents that are owned by the logged-in user. This makes it easy to setup a list of documents per user for various use cases and workflows.

1. Create category

1.1. Navigate to Components > DOCman > Categories.
1.2. Click New.
1.3. Set Title to My Documents.
1.4. Under Permissions set Access to Presets and select Registered

1.5. Click Save & Close.

2. Create menu item for users

2.1. Navigate to Menus > All Menu Items.
2.2. Click New.
2.3. Set Title to My Documents.
2.4. Set the Menu Item Type to (Default) Hierarchical List.

2.5. Set Category to the My Documents category.

2.6. Set Only show own documents to Yes

2.7. Set Access to Registered

2.8 Click Save & New.

3. Create menu item for administrators

3.1. Set Title to All Documents.
3.2. Set Menu Item Type to (Default) Hierarchical List.
3.3. Set Category to the My Documents category.
3.4. Set Access to Special.

3.5. Click Save & Close.

4. Create documents

There are two possible flows when creating documents:

4.1. By a registered user: the document is automatically assigned to the specific user, the user cannot change this himself.
4.2. By an administrator: the administrator needs to change the ownership of the document to a specific user to make it appear in his documents area.

Change ownership: open or create a new document and under Permissions set Owner to a specific user. Read more on owner permissions.

Result

  • Registered users: see the My Documents menu item which lists only their own documents in the My Documents category.
  • Administrators: see the All Documents menu item which lists all the documents in the My Documents category.

More

Prevent document creation

Users can add documents on the front-end if they have Create permissions. Create permissions can be set globally, per category, or per document. 

To prevent users from adding documents in this workflow, make sure the user is part of a user group that doesn't have Create permissions. You can also change the permissions of the user group. 

Category per user

You can create a category for each user, under Permissions set:

1. Owner to the relevant user.
2. Access to Presets and select Special

This will ensure that only the category owner and people in the Special group - such as administrators - can access the category.

By default DOCman cannot automatically create categories for each user that logs-in for the first time. A custom plugin could deliver this functionality.