This article describes how you can create Data Permissions filters for rolling time periods. Using this method, you can limit data access for users to a specific time period, relative to the present.
Data Permissions filters were previously known as Mandatory User Filters (MUFs).
- Data Permissions are attribute-based data access controls, which project administrators can use to limit sensitive or irrelevant data displayed to users who are assigned the filter.
- For more information on Data Permissions filters, see Let's Get Started with Data Permissions.
For example, suppose your project contains data from the previous three years, and more is being added continuously. Through user testing, you discover that some users are not using data from previous years at all. Rather than changing the data of the underlying project, you can simply apply a Data Permissions filter to limit each user’s ability to see data from the current year only.
By defining a Data Permissions filter to the appropriate date attributes, you can limit the data to only the current year for all reports displayed to the affected user.
In general, Data Permissions filters are applied based on individual attribute values. For the rolling time period implementation, the specific attribute values to reference in the Date dimension change with each time period. In the current example, the current year may be
2013 for now, but it will soon change to
2014, so you cannot set the filter definition on a fixed attribute value.
To manage these dynamic values, you can apply one of the following keywords to your Data Permissions expressions:
PREVIOUS: Expression filters for the previous value of the Date attribute.
THIS: Expression filters for the current value of the Date attribute.
NEXT: Expression filters for the upcoming value of the Date attribute.
Example syntax is provided below.
To define a Data Permissions filter, you need the following information:
- URI for the GoodData project.
- URI for each user profile to whom you wish to apply the filter.
- URI for each attribute of each Date dimension for which you wish to define a filter.
The above items can be retrieved from the Manage page in the GoodData project. If your project has a large number of users, you should use the GoodData APIs to retrieve the objects. For more information, see the API documentation.
Applying a Rolling Time Period Data Permissions Filter
In the report below, you can see that data is being displayed from the previous three years.
- To create a Data Permission filter for a specific user, navigate to the gray pages at the following URL:
- Click metadata.
- Click userfilters.
- In the UserFilters screen, you specify the user and the filter to apply to the user. In the User textbox, paste the URI of the user profile to apply the filter.
In the UserFilters textbox, paste the definition of the Data Permissions filter, which should look like the following. Note the use of the
THISkeyword to specify the attribute value:
- Click save.
- The same expression must be applied to each applicable user in the project.
The filter must be applied to each Date dimension in the project, for each user whose data you wish to filter.
When the user accesses the earlier report, the data is displayed only for the current year:
If you are applying rolling time period filters to a project that already contains a number of reports, you should review the titles and descriptions of your reports to verify that they are still accurate after the filters have been applied.