For the complete documentation index, see llms.txt. This page is also available as Markdown.

Data Security

Data Security

Mondrian uses a role-based security model to restrict access to data. Users are assigned to roles, and each role defines what data they can see within the OLAP cube. This allows a single analytics database to serve multiple user types while showing each user only their authorized data.

RBAC

Roles

Mondrian uses a role-based security model to restrict access to data. Users are assigned to roles, and each role defines what data they can see within the ROLAP cube. Consider a sales manager role:

individuals in this position need visibility into their team's performance metrics, product-specific sales figures, and key customer accounts. To fulfill these responsibilities, the sales manager requires access to data spanning products, sales transactions, customer information, and related dimensions.

Within Mondrian, roles must be explicitly defined in the schema where they will be enforced. Creating a role is straightforward—simply declare a Role element and specify its name attribute to identify it.

Role configuration in Pentaho Mondrian requires establishing a connection between Pentaho's authentication system and Mondrian's security layer. This is achieved through a role mapper component.

Configuration Location:

  • File: pentahoObjects.spring.xml

  • Path: pentaho-solutions/system directory

  • Bean ID: Mondrian-UserRoleMapper

The role mapper translates Pentaho user roles into corresponding Mondrian roles, enabling Mondrian to enforce the appropriate security grants defined in your schema.

Pentaho includes three built-in role mapper types to accommodate different security requirements and organizational structures:

One-to-One Role Mapper

The one-to-one role mapper is the most straightforward mapping approach. It directly passes Pentaho user roles to Mondrian without any transformation. For example, if a user has a "Sales Manager" role in Pentaho, Mondrian receives that exact same "Sales Manager" role.

This mapper is widely used because it works seamlessly with existing organizational role structures—there's no need to create separate role names or maintain complex mapping logic between Pentaho and Mondrian.

Security Parameter: failOnEmptyRoleList

This mapper includes an important security parameter that controls behavior when a user has no matching Mondrian roles:

  • Default (Recommended): The mapper throws an exception if no role mapping is found, preventing unauthorized access. This is the secure configuration.

  • Alternative Setting: If set to false, users without matching roles will be granted full permissions to all data—effectively the same as having no security configured at all. This setting should be avoided in production environments.

Best Practice: Leave the default behavior enabled to ensure that only users with explicitly defined roles can access your Mondrian data.

Lookup

The lookup-map role mapper provides a translation layer between Pentaho's role namespace and Mondrian's role definitions. This mapper is essential when role nomenclature differs between systems or when consolidating multiple organizations with distinct role naming conventions onto a unified Mondrian schema.

Configuration: Define mappings as key-value pairs where the key represents the Pentaho role identifier and the value represents the target Mondrian role. During connection establishment, Pentaho resolves the user's roles through this lookup table and transmits the mapped role names to Mondrian's security engine.

This approach allows you to maintain separate role naming conventions in Pentaho while standardizing role definitions within your Mondrian schemas.

User Session

The user-session role mapper retrieves Mondrian role assignments dynamically from a user's session attribute. This approach allows role definitions to be determined at runtime rather than through static configuration.

How It Works:

When Pentaho establishes a connection to Mondrian, the mapper performs the following sequence:

  1. Accesses the user's active session

  2. Retrieves the specified session attribute

  3. Extracts the role value(s) from that attribute

  4. Passes those roles to Mondrian for security enforcement

This dynamic approach is particularly useful when roles need to be calculated or retrieved from external systems during the login process.

Configuration:

The only required configuration is specifying which session attribute contains the role information. For example, if your session attribute is named MondrianUserRoles, you would configure the mapper to read from that attribute. The mapper will then automatically extract and apply whatever role values are stored there.

Security Grants

Suppose you only want the product manager to see the state, item, and quantity purchased. Next, you want the state sales manager to see all of the same data as the US sales manager, but only for the one state. Mondrian security grants can be thought of as a set of filters on the data, and the role can only see what their filters let through. At each level in the schema, the user can have data explicitly restricted or shown.

Level
Scope
Purpose

SchemaGrant

Entire schema

Top-level access control

CubeGrant

Individual cubes

Cube-specific restrictions

DimensionGrant / HierarchyGrant

Dimensions & hierarchies

Dimensional filtering

MemberGrant

Specific members

Fine-grained member access

SchemaGrant

The SchemaGrant is the first and highest level of security control in Mondrian. It has a single attribute called access that determines whether users can see the schema at all.

Three access options are available: all, none, and all_dimensions. However, only all and none are commonly used in practice. The all_dimensions option behaves identically to none and is scheduled for removal in future versions, so it can be safely ignored.

SchemaGrant all

It gives the role access to all of the cubes and dimensions in the schema, but you can later limit access to all or parts of the data using finer detailed grants. Other grants are nested within the schema grant.

SchemaGrant none

This option is used when you want to restrict a user from seeing the schema completely. For example, maybe you have a schema completely dedicated to Human Resources and want to limit it from everyone except HR.

CubeGrant

The CubeGrant takes two attributes: the name of the cube that the grant applies to and the access control for the grant. There are only two options for cube grant access: all or none. Both work similarly to the schema grant, but at the cube level.

CubeGrant all

The all option gives the role access to the cube. If a user has no access to the schema, this gives access to the particular cube but no others.

CubeGrant none

A CubeGrant of none means that a user who is in the given role is not given access to the cube. Unlike with the schema grant, once access to the cube has been taken away, the user can’t see any of the cube data.

DimensionGrant

The Dimension Grant has two required attributes: dimension, the name of the dimension, and access, which can be either all or none. An access of all doesn’t usually add a lot of value, because it’s the default, so you’ll typically only use none. Dimension grants also can’t have any children. If you want finer-grained control over the contents of a dimension, you’ll need to use a hierarchy grant.

HierarchyGrant

The HierarchyGrant has two required attributes: hierarchy, the name of the hierarchy, and access. The name of the hierarchy can be either the full name of the hierarchy or, if the hierarchy name follows the conventions of Mondrian and there is only one, just the dimension name.

For example, if the dimension is named [Product] and the hierarchy is named [Products], it is enough to set the hierarchy name to [Product]. But if you have multiple hierarchies, such as [Org Structure.Financial] and [Org Structure.Reporting], you’d need to specify the full name for the hierarchy you want to use.

HierarchyGrant all

All is used when you want to grant access to the entire hierarchy and all its members. All is the default for hierarchies, so it’s rarely explicitly set.

HierarchyGrant none

The hierarchy access of none restricts a user from seeing a hierarchy, including any of the levels or members in the hierarchy.


Optional Attributes - Top & Bottom

HierarchyGrant includes two optional attributes - topLevel and bottomLevel - that create access boundaries within a hierarchy. Both require access="custom" to function.

topLevel: Hide Upper Levels

Prevents users from viewing data above a specified level.

  • Purpose: Block access to overly aggregated or organization-wide summaries

Example: Restrict managers to Business Unit level, hiding enterprise-level totals

bottomLevel: Hide Lower Levels

Prevents users from viewing data below a specified level.

  • Purpose: Show trends and summaries while hiding granular details

Example: Let sales people see regional performance but hide individual salesperson metrics

Result: Controlled Viewing Range

Together, these attributes define which hierarchy levels are visible—everything above topLevel and below bottomLevel remains hidden.

Top & Bottom

MemberGrant

Member grants provide finer-grained control to dimensions than hierarchy grants. The role has access to the dimension but can only see the specific members that it is given access to.

Member Grant Rules (Order Matters!)

Below is a table that outlines the possible combination access rights which determine the dataset displayed in the report.

[USA] access
[WA] Access
State members

none

Not Specified

{}

all

Not Specified

{[CA],[ID],[OR],[WA]}

none

all

{[WA]}

none

none

{}

all

none

{}

all

all

{[WA]}

Rollup Policy

The Problem: What happens to parent totals when a role can only see some of the children?

A rollup policy controls how Mondrian calculates aggregate values when a user's role restricts access to certain child members. This becomes critical when you want to prevent users from deducing hidden data through mathematical inference.

Real-World Scenario

Setup:

  • Hugo's role allows him to see California and Oregon sales data

  • Hugo cannot see Washington sales data

  • Hugo queries USA total sales and its states

The Question: Should the USA total include Washington's sales (which Hugo cannot see)?

To remedy this, a role can apply a different rollup policy to a hierarchy. The policy describes how a total is calculated for a particular member if the current role can only see some of that member's children:

Policy
Parent Total Includes
Can Deduce Hidden Values?
Best For

full

All children (visible + hidden)

Yes

Low-security scenarios with many children

partial

Only visible children

No

Most common use case; intuitive for users

hidden

Nothing (total hidden)

No

High-security scenarios; sensitive aggregates

Full Policy - Default

The total for that member includes all children. This is the default policy if you don't specify the rollupPolicy attribute.

Hugo's Query Results:

Issue: Hugo can calculate the hidden value: 266,773 - 74,748 - 67,659 = 124,366

When to use: When hiding data isn't critical, or when there are too many children to deduce hidden values.

Partial Policy

The parent total includes ONLY the children the user can access.

Hugo's Query Results:

Benefit: Hugo cannot deduce Washington's sales. The USA total accurately reflects only what he can see.

When to use: When users should only see aggregates of their authorized data. Most intuitive for end users.

Hidden

The parent total is completely hidden if ANY children are inaccessible.

Hugo's Query Results:

Benefit: Maximum security—Fred cannot deduce anything about hidden data.

When to use: When aggregate values themselves are sensitive, or when you want to completely obscure the existence of restricted data.

Rollup Policy - Example

Rollup policies are set per hierarchy within each role. Different hierarchies can have different policies.

Result:

  • Store totals show only accessible children (partial)

  • Customer totals include all children (full)

  • Gender dimension is completely invisible

  • Both hierarchies respect topLevel/bottomLevel restrictions

Was this helpful?