Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Div
idProductTOC

On this page

Table of Contents
maxLevel2
minLevel2
excludeOn this page
typeflat
separatorpipe

Overview

This article describes in detail how to implement a role based security.

Step by step process

Define roles in the database for a confluence user

Use the following commands to create user, role and grant the privileges to the role. The commands work for PostgreSQL database. You may need to contact your DB administrator for the respective commands if you are using other database.

...

Info

Please note that it is necessary for the DB user (the user which we configured for accessing database. Refer to confluence.cfg.xml file in the home directory to get this information) to have the create role permissions in the database/data source.

Set up the data source for SQL

Let's say you have an application data source already defined in server.xml (as shown in the screenshot below), for which you want to implement this role based security. Follow the steps below:  

Image Removed

  1. Go to UPM and find the SQL for Confluence add-on (Manage apps).
  2. Click the Configure button.
  3. Select the View and modify data source profiles tab.
  4. Click Add profile. To add a role based security data source, select the data source as required. Refer to the screenshot below:

    Image Removed

The new profile (in this case "rolebased") is available immediately. Test it on a page to ensure expected behavior.

  • If the user bob tries to access the page: 

Since select on "cwd_group" table is granted to bob, only the respective data is visible but not "cwd_user" table data.

 Image Removed

  • If any other user (let's say random user who has no database role associated with their own account/userid) tries to access the page: 

Since there is no role associated with this user, an error message will be shown.

Image Removed

Image Removed

Include Page
SUPPORT:How to implement role based security for Postgre SQL database - 10.x
SUPPORT:How to implement role based security for Postgre SQL database - 10.x