How to Restrict Table Columns for Viewing and Editing in Confluence

August 13, 2020
#How To#Confluence Tutorial#Confluence
9 min

Confluence tables allow you to structure and organize relevant information neatly. Nevertheless, the standard table functions are very simple and come down to resizing columns, coloring cells, rows and columns, and sorting the table by clicking the column headers.

No doubt that everyday work challenges bring far more advanced use cases with Confluence tables. So you have to think over workarounds that will help you to achieve your goals.

For example, your table may contain sensitive information about the company and its employees (bank accounts, passport data, system passwords, etc.). Only specific users can edit such confidential data, and only several employees need permission to view this content.

It is possible to restrict pages in Confluence for viewing and editing. But there is no solution to hide several table columns (rows) and prevent other users or groups from making any changes to them.

To cope with this task, you need to use the Table Filter and Charts for Confluence app. Let us guide you through the case step by step.

Use case

You want to create a table containing information about your employees. Such columns as Name, Address, Phone Number, and Email are public, and everybody can view them. You need to limit access to the Salary and Bank Account columns, and define the following restrictions:

  • The chief accountant John Smith can view and edit the table.
  • The accountant Erin Lee can view the table, but not edit the table.
  • Other Confluence users can’t see the confidential columns.

Confluence table with columns needed to be both public and confidential

Step 1. Create two pages and apply page restrictions

The first step is to create two Confluence pages. The first one should be unrestricted: everybody can view and edit its content.

The second page is related to the sensitive data, so its restrictions should match your original task:

  • John Smith can view and edit the page content.
  • Erin Lee can view the information.
  • Other users have no access to the page.

Two Confluence pages, both restricted and public

Step 2. Create two separate tables: public and confidential

The second step is to create two tables from the source table:

  • The public table goes to the unrestricted page.

Confluence table with public columns

 

  • The confidential table is placed on the restricted one.

Confluence table with confidential columns

Pro tip:

Learn more about using Spreadsheets in Confluence

Step 3. Reuse and merge the confidential table with the public one

Now it’s time to combine the two tables.

Firstly, use the Table Excerpt and Table Excerpt Include macros to reuse the confidential table on the unrestricted page. Just wrap the table in the Table Excerpt macro and assign a unique name to it.

Table Excerpt macro preview

 

Then go to the required page, insert the Table Excerpt Include macro, type in the corresponding Excerpt name, and choose its source.

Secondly, wrap both tables (the public one and the reused one) in the Table Transformer macro. To combine the tables, you need to choose the default Lookup tables preset and specify the matching column (it will be Name for the case). The result table is merged automatically.

Let’s log in to the system as Erin Lee and check the results.

As you can see, Erin can view the whole table. If she wants to edit the public part, she just makes changes to the unrestricted page. This page contains only a reused version of the confidential table, so Erin Lee can go to the source restricted page but won’t find the Edit button there.

Confluence tables restricted for particular users

 

Now let’s log in to the system as a regular user, for example, as Simon Doe.

Simon can view and edit only the public part of the table. He has no access to the confidential columns. If Simon Doe enters the Edit mode and opens the Table Excerpt Include macro, he won’t see the reused table in the preview. Moreover, he won’t get any sensitive data from the HTML code of the page.

Of course, the restricted page with the confidential table won’t be visible to him in the space Page tree.

Confluence table available for editing without restrictions

 

The Table Filter and Charts for Confluence app provides a wide set of useful macros to get maximum from pages and tables in Confluence. It can also improve your work experience and ease everyday routine tasks based on the standard Confluence macros: