Row Level Security Filters (RLS)

  • Row Level Security is a superset feature used to filter data on charts based on predefined conditions.

  • It is made of two elements, Logical operator and Dashboard filters.

RLS Panel

Logical operator

It allows combining a set of filters with one of the logical operators: AND or OR.

For example, if a list of filters is added with condition_one, condition_two, condition_three…​ and OR is selected, the resulting query would be:

condition_one OR condition_two OR condition_three

Dashboard filters

Dashboard filters represent the list of filters to apply on the charts of the dashboard. The created filters are translated to SQL queries.

To create a valid filter, fill the four columns:

  • Name: The name of the chart, as it is written on BI studio.

  • Column: The name of the column in the dataset used to create the chart.

  • Operator: A dropdown list containing a set of operations available to create the filter.

  • Value: The value your filter is based on.

Name

The name of the chart should be as it is in the chart title.

Column

The name of the column within the dataset columns.

It appears in the chart itself or on the left side of the chart on BI studio.

Operator

All the SQL operators are allowed:

Comparison operators

=, !=, >, =>, <, <=

List operators

IN, NOT IN

Nullability

IS NULL, IS NOT NULL

Boolean

IS TRUE, IS FALSE

String comparison

LIKE, NOT LIKE

Value

The value can be empty, static, dynamic or list.

  • Empty: When checking the nullability of a field, or if it is a boolean.

  • Static: Can be a number or string.

  • List: Usually when working with IN and NOT IN operators, the value should be a list of elements separated with a comma (,).

  • Dynamic: The value can be a groovy expression, and it can contain the built-in variables,

    • __user__: get the current user’s properties

    • __parent__: read properties of the current model (mainly useful when extending dashboards in dashlet)

    • __date__: current date

    • __time__: current time

    • __datetime__: current date time

Notes

  • Filters are applied in the SQL query with a WHERE clause

WHERE column_name :operator: value
  • If any of the chart name, field or value is not valid, the module will display some errors and the invalid fields will be displayed in red. RLS errors

    1. The column name is not valid, it should be created_by instead of createdBy.

    2. The chart name is not valid as Team is not present in the dashboard. The possible values there are: Nb of teams, Teams diagram or Teams.

  • The filters with a value containing __parent__ are not applied directly on the dashboard but only when it is extended in a specific page as a panel-dashlet.

  • In reality, the filters are applied on the datasets used by the charts. So if you have several charts relying on the same dataset, the filters will apply on all the charts based on the underlying dataset of the chosen chart (see example below).

When you define some filters on a dashboard, it’s strongly recommended to avoid having several charts with the same name on a dashboard, especially if they don’t rely on the same dataset. Otherwise, the filters defined on the duplicated chart name might be applied on the wrong dataset.

Example

Dashboard without filters

Dashboard

Dashboard with filters

Filtered Dashboard