Row Level Security Filters (RLS)

  • Row level security is a superset feature allow to display data on charts filtered based on predefined conditions.

  • It contains two main components, 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

Example: if a list of filters is added, condition_one, condition_two ,condition_three…​ and OR is selected, the resulted query would be

condition_one OR condition_two OR condition_three

Dashboard filters

  • Represent the list of filters to apply on the charts of the dashboard.

  • Created filters are translated to SQL queries

To create a valid filter you asked to fill the four columns:

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

  • Field: the name of the column of the dataset used to create the chart

  • Operator: a dropdown list containing a set of operations possible to create filter

  • Value: the value your filter is based on.

Name

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

Field

The name of the column within dataset columns.

To get the right name of the column it would appear whether in chart itself or on the left side of the chart’s page on studio

Operator

All the SQL operator 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: generally when checking the nullability of a field or if 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 comma (,)

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

    • __user__: to get the current user’s properties

    • __parent__: to 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 translated to SQL Query in WHERE clause

WHERE field_name :operator: value
  • If any of the chart name, field or value is not valid it will display error message and the invalid field will appear red.

RLS errors

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

Example

  • Dashboard without filter

Dashboard

  • Dashboard with filter

Filtered Dashboard