MATIH Platform is in active MVP development. Documentation reflects current implementation status.
10. Data Catalog & Governance
Governance
Row-Level Security

Row-Level Security

Row-Level Security (RLS) in the Data Catalog restricts which rows a user can access within a table based on governance policies. RLS policies are evaluated at query time and inject filter conditions into the query before execution, ensuring users only see data they are authorized to access.


How RLS Works

RLS policies are implemented as governance policies of type ACCESS_CONTROL with rules that define row-level filtering conditions. When a query targets a table covered by an RLS policy, the policy evaluator determines which filter predicates to apply based on the user's attributes.

User Query: SELECT * FROM customers
    |
    v
Load RLS Policies for 'customers' table
    |
    v
Evaluate User Attributes Against Policy Rules
    |
    v
Inject Row Filters: WHERE region IN ('US', 'EU')
    |
    v
Execute Filtered Query

RLS Policy Configuration

FieldDescription
policyTypeSet to ACCESS_CONTROL
scopeTypeTypically TABLE or DATABASE
scopeEntitiesList of table FQNs or IDs the policy applies to
enforcementModeControls whether filtering is strict or advisory
rulesList of filter rules with conditions

Rule Parameters for RLS

ParameterDescription
attributeUser attribute to match (e.g., region, department)
valueExpected value for the attribute
operatorComparison operator (equals, contains, regex)
columnTable column to filter on
filterExpressionSQL predicate to inject into the query

Example RLS Policy

{
  "name": "Regional Data Access",
  "policyType": "ACCESS_CONTROL",
  "scopeType": "TABLE",
  "scopeEntities": ["delta.sales.customers"],
  "enforcementMode": "HARD_ENFORCE",
  "rules": [
    {
      "name": "Region Filter",
      "ruleType": "ATTRIBUTE_MATCH",
      "parameters": {
        "attribute": "region",
        "value": "${user.region}",
        "operator": "equals"
      },
      "enabled": true,
      "order": 1
    }
  ],
  "enforcementActions": [
    {
      "actionType": "LOG",
      "parameters": {
        "logLevel": "INFO"
      },
      "order": 1
    }
  ]
}

Scope Levels

RLS policies support multiple scope levels for flexible coverage.

Scope LevelFilter Applied To
TABLESpecific tables listed in scope entities
DATABASEAll tables in the specified database
SCHEMAAll tables in the specified schema
TAGAll tables tagged with the specified tag
CLASSIFICATIONAll tables with the specified classification
GLOBALAll tables across all catalogs

Enforcement Actions

When an RLS violation is detected, the configured enforcement actions execute in order.

Action TypeDescription
BLOCKPrevent query execution entirely
MASKApply data masking to restricted rows
LOGRecord the access attempt in the audit log
ALERTSend an alert to data stewards
NOTIFYNotify the user about restricted access

Combining RLS with Other Policies

RLS policies can coexist with other governance policy types. The policy evaluator processes all applicable policies in priority order. A higher priority number means the policy is evaluated first.

Policy TypeInteraction with RLS
Column maskingApplied after row filtering
ClassificationDetermines which RLS scope applies
AuditLogs all access regardless of RLS outcome
Usage limitsApplied independently of row filters