Row level security is implemented through the configuration of filter queries, that are applied at backend. This provides a very flexible way to restrict rows - you can restrict rows for any table in SAS, be that a dataset or a database.
The columns in MPE_ROW_LEVEL_SECURITY should be configured as follows:
### RLS_SCOPE
Determines whether the rule applies to the VIEW page, the EDIT page, or ALL pages.
### RLS_GROUP
The SAS Group to which the rule applies. The user could also be a member of a [DC group](/dcc-groups). If a user is in none of these groups, no rules apply. If the user is in multiple groups, then the rules for each are applied with an OR condition.
### RLS_LIBREF
The library of the target table against which the rule will be applied
### RLS_TABLE
The target table against which the rule will be applied
### RLS_GROUP_LOGIC
When creating multiple subgroups (identified by SUBGROUP_ID) this determines whether those groups are joined using an AND, or an OR condition. This value should be the same for the entire query (unique per RLS_SCOPE/RLS_GROUP/RLS_LIBREF/RLS_TABLE combination).
This is the value used to the right of the operator. It is important to enter the values in the correct format, else validation failures will ensue (the backend will reject incorrect syntax to avoid the risk of SAS code injection).
The format depends on the operator, and the variable type.
* All character values MUST be enclosed in single quotes (eg 'example')
* IN and NOT IN must be wrapped in brackets
* BETWEEN must contain an AND
If there are invalid values, an error message will be shown, identifying which value was invalid. If you would like to inspect the validation routine, take a look at [mp_filtercheck.sas](https://core.sasjs.io/mp__filtercheck_8sas.html).
### RLS_ACTIVE
If you would like this rule to be applied, be sure this value is set to 1.