Data authorization or Data access control (optional)
Data authorization or data access control is defined with user filters, which are used to restrict data based on a parameter such as a UserID or DepartmentID. You can use URL parameters to filter data. For example, you can use the UserID passed from the HTTP authentication request to identify the user's group, and filter all data to display only authorized data for that user's group. If you have a dashboard but only want users to see data filtered by their group_id, you can create the filter here for use in a record or metric.
- In Admin Console, on the Documents Tree, right-click User filters, and click New. Name the filter and click OK.
-
Enter the following filter details.
- In the Name field, assign a name to the filter.
- In the Source field, select a connection source to a database from the tab. This connects to a database that the Query (filter) runs against.
-
In the
Query field, enter
the query to execute on the database specified in the
Source field. Define
a custom query for the filter according to your configuration.
Note Within an SQL statement, each of the URL properties should be placed within angle brackets and single quotation marks to avoid SQL injections.
- Example
-
Select Clients from Clients_mapping where Staff_ID = ’<UserID>’
Where:
Clients, Staff_ID - are fields in the Clients_Mapping table
UserID - is a parameter from an HTTP request
-
Apply the newly created filter as needed for dimensions of
records or metrics within
Insight
Studio.
- Log in to Insight Studio.
- Open a metric or a record to which the filter will be applied.
-
Select the field that needs to be filtered. On the
Property Panel, select
Filter. From the list
of filters, select the filter created above.
In the sample screen below, the LoginID field in the record is filtered by the user filter named AllowedIDs. This user filter is applied to all users, including the Administrator user.