This article provides a basic overview of Data Permissions. In GoodData, a Data Permissions filter is a predefined parameter that is included in all queries submitted to the datastore by the user to which they are assigned. Based on an attribute defined in the logical data model of the project, Data Permissions filters can be used to filter the data that is displayed to the user. For example, Data Permissions filters can be configured to filter data by user identifier, job title, or region. This basic example shows how to create and assign Data Permissions.
Data Permissions were formerly called Mandatory User Filters.
For a step-by-step tutorial on setting up Data Permissions filters, see Getting Started with Data Permissions.
Data Permissions are generally applied at the highest table of a data model. Suppose you want to filter the data model by an attribute named
Client Name. A Data Permissions filter needs to be created for each instance of this attribute. If the dataset includes two companies, Business A and Business B, then each company requires its own attribute value.
This article utilizes the gray pages for creating and deploying the Data Permissions.
For the implementation of Data Permissions across a large number of projects, however, you should use the GoodData APIs, which enable deployment of changes across multiple projects in a programmatic fashion.
By way of introduction, however, please complete the steps in this article to learn the basic process.
The following basic steps need to be executed in this order to create a new Data Permissions filter and to apply it to users in the project:
- Get the object identifier of the attribute on which to filter.
- Get the object identifier of the field value (element) of the attribute on which to filter.
- Execute code to create the Data Permissions filter.
- Locate the identifier of the user to which you wish to apply the filter.
- Execute the code to apply the filter to the specified user.
- Repeat the last two steps to apply the Data Permissions filter to other users.
- Repeat all of these steps to create and apply additional Data Permissions.
Creating the User Filter
In the sections below, URLs reference the domain
Identifying the filtering attribute
First, find the ID for the Attribute you want to use as the filter:
Search this location for the title of your attribute. Click the name to get more information.
The last set of digits of the web address is the object identifier for the attribute. Write down this value.
The above indicates the attribute to use, and the object ID is
In the same location, around the fourth grouping of code is a link for
Click the link to the Elements page. On the Elements page, you can scroll down and find the field you want to filter.
In our example, we want to filter only Company data. Locate the data element value and write down the identifier.
In the above, the ID for this data value is
Creating the filter
Next, you must create and execute the code to create the filter.
Go to the following address:
Below is the code to run. For Content Type, use JSON:
For our example, the code to use is listed below. The Object ID for the attribute on which to filter and the Element ID for the data value you want filtered have been inserted into the value for
When the request is submitted, the GoodData platform returns a single line containing a URI. Click the link to confirm that the filter has been created and to retrieve the identifier for the filter, which is the last set of digits in the web address.
In the above, the ID for this user filter is
To ensure that the filter has been populated across the entire project, load an instance of a project dashboard in the GoodData Portal, and then select Refresh in your browser.
Assigning the Data Permissions filter to a User
Now, you must assign the filter to a user. Go to this address:
For our example, the address to use is the following:
The above opens the user filter submission page, where you can locate the identifier of the user on which to filter. The user list is available in the gray pages:
For our example, the address to use is the following:
The user list for the project is displayed. Here, you can search for the users to which you wish to apply the filter.
For each user, you want to copy and paste the corresponding text that goes with the self link. Keep this link handy:
In this example, this link is the one to use to filter the data for the user.
Submit filter request
Finally, the filter request must be submitted to GoodData. Go to this link:
In the User text box, paste the link from the self link above. Example:
The following code needs to be submitted in the UserFilters section. If you are using the GoodData API, use a POST request with following payload:
For our example, here’s the code:
This code assigns user 70a…c03 to the filter 91074. When submitted, the response should indicate a success or an error.
Multiple filters can be assigned per user at once.
To use the gray pages, you just need to input the User URI and Filter URI to the input fields:
Insert each user filter as a separate line. See another example on the screenshot below:
That’s it. Data is filtered for the specified user, using the Data Permissions filter you created.
This technique can be used to perform filtration of data for a wide variety of use cases. Please note that these filters are ALWAYS applied to queries submitted by the users to which they have been assigned.
For more information about Data Permissions, see Powered by GoodData Quick Start - Create Data Permissions.