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


Section


Column
width650

Description

The Atlassian folks come up with a way to implement a role based security based on user ids IDs to help them manage their data access better. This requires app app version 5.2 and  at least and is simple to configure for the app using using data source profiles. This does require your database be setup set up so that roles that roles are defined for each user in Confluence.

Steps

  1. Have Ensure that the database administrator define has defined roles for each Confluence user by user id ID and set appropriate authority to data based on roles. A role for anonymous should must also be added.
  2. Go to UPM Atlassian Marketplace > Manage apps and find the the SQL.
  3. Press the Configure button.
  4. Select the Click Configure and select the View and modify data source profiles tab.
  5. Click Add profile. In  In the Add profile window:
    • Add a dataSource parameter to reference an application server data source, if it has a different name that the profile.
    • Add beforeSql and afterSql  and afterSql parameters similar to the example under the Extended parameters tab.
    Image Added

The new profile is available immediately - test it on a page to ensure expected behavior.

Image Removed

Tip
titleImplementation without page updates

Once you are finished testing, you can use data source alias support to change an existing (application server) data source to use the new role based security model without requiring any page updates. Simply rename the data source profile to the same name as the existing (application server) data source already used in the SQL macros.


Warning
titleCache macro

The Cache macro should must not be used around any content that is rendered differently for different users. The role based model described here renders differently depending on the user, so the Cache macro should must not be used in this case.

Anchor
Example
Example
Example

For Postgres, the The following SQL works for Postgres:

No Format
beforeSql=begin; SET LOCAL ROLE @user_id@; 
afterSql=; rollback;

The substitution variable @user_id@ is replaced in SQL by the SQL macros with the current logged in user id ID or anonymous (if not logged in).

...