Documents plugin
The Documents plugin is a tool to manage End-User License Agreements (EULAs), GDPRs and other type of documents within the platform. This plugin enables users to read, accept, and track documents, ensuring compliance. A user can view its accepted documents in 'Settings and profile' -> 'Documents'.
Configuration
To enable the functionality, set the following value to true in the core configuration:
mesh:
documents:
requireDocumentAcceptance: true
Adding a document
To add a document in the database, you can initiate a POST request to api/documents/
. This request should be appropriately authorized with a Bearer token, for which the user must possess the RBAC role documents.document.insert
.
Additionally, the request must include following metadata in the body, using the multipart/form-data
body type:
- name: the name of the document.
- acceptance_type: Can be one of 'MANDATORY', 'ACKNOWLEDGMENT' or 'CONSULTANCY'.
- content: the file of the document.
- mime_type: the mime_type of the document.
- enabled: a boolean value, indicates if the document is active.
Additionally, you can specify additional optional info:
- description: a short description of the document.
- document_type: the type of the document, e.g. GDPR, EULA.
Using cURL
Here is an example of a cURL request:
curl --location 'http://ui.witboost.com/api/documents/' \
--header 'Authorization: Bearer {your_token}' \
--form 'name="MyDocument"' \
--form 'description="An example document"' \
--form 'document_type="EULA"' \
--form 'acceptance_type="MANDATORY"' \
--form 'content=@"/path/to/file.pdf"' \
--form 'mime_type="application/pdf"' \
--form 'enabled="true"'
Using Postman
You can also use Postman to send the HTTP request. Make sure to use form-data
as body type. For the content
parameter you can change its type to 'File' instead of 'Text', and Postman will let you select a file in your local file system.
Managing documents
Acceptance type
The acceptance type of a document modifies its behaviour. It can be one of [ MANDATORY, ACKNOWLEDGMENT, CONSULTANCY ].
- Mandatory: the user will be shown the document and he can choose to accept or reject the agreement and, if rejected, he cannot use the platform.
- Acknowledgment: the user will be shown the document, and he can confirm having read it.
- Consultancy: the user will not be shown the document at login. If he wants to, he can actively search and read the document in the documents consultancy page.
Document consultancy
Other than the popup, the user will have a dedicated window in the 'Settings and profile' section of the platform to consult already accepted documents. Documents that are not enabled will not be shown.