# Demo using UI

## 1. Document reviews

### 1.1 Overview

To enable document reviews within a policy, a corresponding button must be made available in the grid. (This button is combined with the document view function.)

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-5c7888a7ad94e1706d218857396bc1cc7688e326%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

This button will appear in the grid for documents, showing a number of existing comments for each of them.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-7df3fc7b49784e610e3d82cc1cf8d44e977f3999%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

### 1.2 Discussions

When opening a comments section a list of discussions is displayed. To create a comment, users must either select an existing discussion or create a new one.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-e0e744e0c945f198f2f5bcfcbeae7c9012201af5%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

#### 1.2.1 Creating a Discussion

To create a discussion several fields must be filled out:

**Discussion name** - arbitrary human readable name (usually used for indicating the topic of the discussion).

**Relationships** – references to other documents related to the current one.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-12f2ba5178d2c009513ae409cbf771e004f3801f%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Selecting document in the ‘relationships’ will cause the discussion to be shown when viewing them as well.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-cf4b5a9bbb0cd1e3801624a1b6ff92dda62a532c%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

You can also link a discussion to a specific field in the document by adding a field reference.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-2bfde44a5583f02b7d6581004fd31978da35936a%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

1. **Visibility Scope**\
   The visibility scope determines who can see a given discussion.

a. **Public** – all users who have access to the document

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-cbe91597f0cb254adac08815a5780930030e6de7%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

b. **Roles** – users with specific roles (and the creator of the discussion)

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-37ef9eaec89fcfecceb7f4dae19d51e7b7ff1290%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

c. **Users** – only specified users (and the creator of the discussion)

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-5adfe340544b5393d75063f5a06e187baa9a66f3%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

#### 1.2.2 Viewing

You can search for the desired discussion using a **search** function.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-de4a7816c7a447a2626961978747661d79d6e32f%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Also it is possible to search (filter) discussions based on their field links

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-37c30d8396bb9b4e62d256e876a6b8e0171d1c68%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

The list of discussion participants can be viewed inside each discussion.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-117f4d56731ea066be6c8bd6cb01124c6a8b3e83%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

### 1.3 Messages

#### 1.3.1 User mentions

Users can be mentioned in messages using @username notation.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-13012281e46f03924e987afbf6bec57ad5bf7e64%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

#### 1.3.2 Field References

Fields in a document can be referenced in messages using #fieldname notation.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-1ce859a968fd2925ac8f1542c2227a9c60d23f38%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Fields in a document can be referenced in messages also using the link button. 

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-fa5e02ee63868c86f766839af78bfc22b8792f2b%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

#### 1.3.3 Attachments

Files can be attached to messages.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-da468ddab36258bc0669d63ad5051c1ad62c13e6%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Files, as well as messages, are encrypted and stored in IPFS.

Hedera Topics contain messages with meta-information and links to the corresponding document and attached files.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-3f6d4a1954f566ac663ff0ce589e050e3a80a6b2%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

## 2. Document Revisions

### 2.1 Configuration

To allow document revision, a corresponding button (requestVcDocumentBlock) must be added. To configure requestVcDocumentBlock to enable editing, the operation type must be set to Edit.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-40f3b0fe3d87783493afaa533f6ff6d7d631784e%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

### 2.2 Events

As with creating a new document, editing a document revision triggers a standard event that saves a new version of the document.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-55bed56a656b212784f42889db8780c3d9984f9a%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

The old revision of the document is automatically marked as outdated. To hide ‘outdated’ revisions of the documents from the grid, enable “Hide previous versions.”  

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-a5e0606102c4b4dded2449cba7f55d7cab96600e%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

## 3. Access control

Since discussions are published encrypted, keys are required to access (e.g. for audits) their content - comments and attached documents.

### 3.1 Guardian user Permissions

To enable access to all policy artifacts, audit permission in the policy configuration must be assigned to the corresponding user/role.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-c95ef4b24dec5c595c4681727151e7b73281f4a3%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

### 3.2 Documents

Audit permission allows access to all documents within the policy.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-122939a4b1a81a2d45c13982276e5549a0033e75%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-695acc6a7e31c651d3880e55fc1166167dab63b9%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

#### 3.3 Encryption keys

Audit permission grants access to discussion encryption keys. These keys make it possible to decrypt messages within discussions for verification purposes.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-a89715e016a359f15cf745d32c88606ccb227f3c%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

## 4. Indexer view

Because discussion content is published encrypted, to view their content Indexer users need to provide the corresponding encryption keys.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-3ee2ca0f474c842e8db57752baa5e6f1999c849d%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

When provided, keys are never stored. They are used solely within the current user session to decrypt messages encrypted with the corresponding key, which are automatically identified by the Indexer. 

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-c4564a34215d2ae4d7839be793e52dca79ffb45f%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-acf6203b3b44b95259cf71f313c3299cfb3c73a3%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
