Applies to eMondrian Community release 2026.11.16.1 and later.
Different people may see different parts of the same data. A regional manager may see their region only; finance may see costs and margins, sales may not. Without access rules in the model, there are two options: a separate copy of the report or model for each audience, or everyone sees everything.
Row-level and object-level security give a third option: one model and one report, and each user sees only what they are allowed to see.
In eMondrian the rules live in one place: the semantic model. Excel, Power BI, eMondrian Dashboard and AI agents over MCP all query the same model, and the model decides what each user sees.
Row-level and object-level security
A semantic model answers two questions about every user: which data may they see, and which parts of the model may they see.
Row-level security (RLS) limits the data. Two users open the same report and see different rows: a regional manager sees their region, a store manager sees their store. The report, the measures and the dimensions are the same for both; the rows and the totals are different.
Object-level security (OLS) limits the model itself. A measure, a hierarchy or a whole dimension can be hidden from a user. For that user the object doesn’t exist: it isn’t in the field list, and a query that names it gets an error. Typical cases are costs and margins, salaries, or customer details.
In eMondrian both are set with roles in the schema. A role lists what its users may see: cubes, dimensions, hierarchies, members and measures. Users get roles through their groups. The server applies the role to every query, whichever tool sent it.
The model
The example uses the FoodMart sample, cube Sales, year 1997. Three states have sales:
| Store State | Unit Sales |
|---|---|
| CA | 74,748 |
| OR | 67,659 |
| WA | 124,366 |
| Total | 266,773 |
The schema has two roles and a default role:
- Sales-A sees California only.
- Sales-B sees Washington only. Store Cost, the Weekly hierarchy of Time and the Promotions dimension are hidden from it.
- No Access is the default role: a user with neither role sees no cubes.
<Role name="No Access">
<SchemaGrant access="none"/>
</Role>
<Role name="Sales-A">
<SchemaGrant access="none">
<CubeGrant cube="Sales" access="all">
<HierarchyGrant hierarchy="[Store]" access="custom" rollupPolicy="partial">
<MemberGrant member="[Store].[USA].[CA]" access="all"/>
</HierarchyGrant>
</CubeGrant>
</SchemaGrant>
<RoleMember name="/Sales-A"/>
</Role>
<Role name="Sales-B">
<SchemaGrant access="none">
<CubeGrant cube="Sales" access="all">
<HierarchyGrant hierarchy="[Store]" access="custom" rollupPolicy="partial">
<MemberGrant member="[Store].[USA].[WA]" access="all"/>
</HierarchyGrant>
<HierarchyGrant hierarchy="[Measures]" access="custom">
<MemberGrant member="[Measures].[Store Cost]" access="none"/>
</HierarchyGrant>
<HierarchyGrant hierarchy="[Time.Weekly]" access="none"/>
<DimensionGrant dimension="[Promotions]" access="none"/>
</CubeGrant>
</SchemaGrant>
<RoleMember name="/Sales-B"/>
</Role>RoleMember names a group by its full path. With authentication on, eMondrian takes the user’s groups at every request and applies the matching roles. The schema sets defaultRole="No Access".
Three users:
| User | Group | Role |
|---|---|---|
| user-a | /Sales-A | Sales-A |
| user-b | /Sales-B | Sales-B |
| user-c | — | No Access |
Four tools, three users
Each user asked the same question in each tool: Unit Sales by Store State, 1997.
| Tool | user-a | user-b | user-c |
|---|---|---|---|
| Excel (PivotTable) | CA 74,748 | WA 124,366 | Cube not found |
| Power BI (live connection) | CA 74,748 | WA 124,366 | Cube not found |
| eMondrian Dashboard | CA 74,748 | WA 124,366 | Dashboard not found |
| AI agent over MCP | CA 74,748 | WA 124,366 | No cubes |
The numbers match in every tool, because every tool asks the same model. Excel sends MDX, Power BI sends DAX, the dashboard and the agent send queries through the same server. The role is applied inside the server, before any query reaches the database.
The dashboard was built by the administrator and shared with the groups /Sales-A and /Sales-B with Can view. Each viewer sees the same dashboard with their own data: the visuals read their data with the viewer’s roles. user-c has no right on the dashboard, so it opens as not found. See Dashboard access.
Rows: each user sees their own states
The role lists the members a user may see. Everything else is filtered out in every query: on rows, in filters and in totals.
The totals depend on rollupPolicy:
rollupPolicy | Total for user-a |
|---|---|
partial | 74,748, the sum of the visible states |
full | 266,773, the total of all states |
With full, the total row shows the company’s full figure to a user who sees one state. For row-level security, use partial: the total is the sum of what the user may see, in all four tools.
Objects: measures, hierarchies and dimensions
Object-level security hides parts of the model itself. For user-b, three objects are hidden.
A measure. Store Cost isn’t in the field list of Excel or Power BI, isn’t returned by the agent’s describe_cube, and isn’t offered in the dashboard. A query that names it gets an error, in MDX and in DAX:
MDX object '[Measures].[Store Cost]' not found
Calculated measures built on a hidden measure are hidden too. Profit is Store Sales minus Store Cost, so user-b doesn’t see Profit or Profit Growth either. The margin can’t be worked out from what remains.
A hierarchy. The Time dimension has two hierarchies: Time (Year, Quarter, Month) and Weekly (Year, Week, Day). user-b sees Time; Weekly is hidden. It isn’t in the field list, in describe_cube or in the dashboard, and a query that names it gets an error.
A dimension. The whole Promotions dimension, with all its hierarchies, is hidden from user-b.
For the user, a hidden object doesn’t exist: there is nothing to click and nothing to ask about.
The agent acts as the user
An AI agent connected over MCP signs in as a user and gets that user’s roles. When user-b asks the agent for store costs, the agent’s tools don’t know the measure: the model it sees has no Store Cost.
Every MCP call is written to logs/mcp-audit.log with the name of the user.
Summary
- One model, one set of rules: roles in the schema.
- Excel, Power BI, eMondrian Dashboard and AI agents get the same numbers for the same user.
- Rows: members per role, with
rollupPolicy="partial"for honest totals. - Objects: measures, calculated measures built on them, hierarchies and dimensions.
- Groups come from Keycloak, Active Directory or LDAP; see Security and Roles in the schema.