Adding Row Level
Security to a Pentaho Metadata Model
Row Level Security allows you to control the results that are returned in a query based on a user's security level. You can specify which rows of data each User Role or User ID is allowed to retrieve from the database, based on some column of data, or combination of columns of data.
Within the Metadata Editor, select the model to add Row Level Security to, right click on the Model, and select "Edit...".
WARNING: Row Level Security is only in effect at the Model level. Any data constraints defined below the Model Level, such in a Business Table or Business Column, is ignored and not used.
From the Model Properties dialog, select the General -> Data Constraints Property:
By default, Row Level Security is not enabled. There are two forms of Row Level Security in Pentaho Metadata, Global Constraint and Role Based Constraints.
This example defines an MQL Formula for three different roles. The Admin Role has full row visibility, the Sales and Engineering Roles may only see data that joins to rows with their particular department. (The syntax is [business_table.business_column] = value).
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="fb41c38d-db49-43b1-a93c-26526be1e3b3"><ac:plain-text-body><![CDATA[
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="898efa62-a531-4bec-941f-0ac428ea1496"><ac:plain-text-body><![CDATA[
Row Level Security Constraints are applied at the MQL Layer. The Business Columns referenced in the MQL Security Constraints will be resolved down to SQL Table Columns. The Tables which contain column references included in security constraints will be joined to your query, based on the relationships defined in the Business Model. It is recommended that you do not use outer joined business columns for the purposes of security constraints.