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.

It consists of a set of filters, which are applied to dataset properties. The filters define what the user will be able to see (not the other way - they do not filter out).

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.

Image Removed

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.

Code Block
titleData permission object syntax
{
    "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
titleExample of a dumped data permission
collapsetrue
{
    "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

...

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

...

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.

...

Panel
panelIconId1f389
panelIcon:tada:
panelIconText🎉
bgColor#E3FCEF

The content you are trying to reach has been moved here: https://docs.clevermaps.io/docs/data-permissions

We are proud to announce that we have launched a new documentation.

Please update your saved links and bookmarks to follow a new address docs.clevermaps.io.