Versions Compared

Key

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

Data permission object refines access to data for specific users on the level of database rows.

...

Let's say have a table representing two types of stores in our project. We want to restrict the user's access to "My store" shops, based on the value of the partner column.

...

Syntax

This data permission allows the user to view only the Partner shops in the Retail Solution Demo project.

This user might be the manager of the Partner store chain. However, he does not have the rights to see the performance of the main store chain.

...

Data permission object syntax
title
Code Block
{
    "name": "partners_permission",
    "type": "dataPermission",
    "description": "Permission allowing to view only Partner shops.",
    "content": {
        "accountId": "00ubfu6dpmnTMIQKs0h7",
        "filters": [
            {
                "property": "shops.partner",
                "value": "yes",
                "operator": "eq"
            }
        ]
    }
}

Code Block


Example of a dumped data permission
true
collapse
Code Block
{
    "url": "/rest/projects/yufqzxkbiecj7jot/md/dataPermissions/q4lq2p1d26i5gfqr",
    "dumpTime": "2018-01-29T17:02:01Z",
    "version": "1",
    "content": {
        "id": "q4lq2p1d26i5gfqr",
        "name": "partners_permission",
        "type": "dataPermission",
        "description": "Permission allowing to view only Partner shops.",
        "content": {
            "accountId": "00ubfu6dpmnTMIQKs0h7",
            "filters": [
                {
                    "property": "shops.partner",
                    "value": "yes",
                    "operator": "eq"
                }
            ]
        },
        "accessInfo": {
            "createdAt": "2018-01-29T15:50:39Z",
            "modifiedAt": "2018-01-29T16:02:01Z"
        },
        "links": [
            {
                "rel": "self",
                "href": "/rest/projects/yufqzxkbiecj7jot/md/dataPermissions?accountId=00ubfu6dpmnTMIQKs0h7"
            }
        ]
    }
}

Key description

content

Key

Type

Optionality

Description

Constraints

accountId

string

Status
colourRed
titlerequired

ID of the account to which the permissions will be applied

(warning) currently, the only way to learn your accountId is through our REST API

(a-zA-Z0-9)

filters

array

Status
colourRed
titlerequired

array of filterBy objects which will be applied to dataset properties

see metric.content.options.filterBy


Visual representation

If a data permission is applied to you as a logged user, you are notified about this fact by having an active data permission filter in the Filters tool.

...