SSAS 表格模型中高级行级安全性的最佳做法是什么?

What are the best practices for advanced row-level security in SSAS tabular models?

我目前正在建立销售领域的新数据模型。在我要替换的旧数据模型中,我为每个用户设置了非常具体的行级安全设置:有时,设置可以使用“AND”过滤器完成:

UserXY should have access to all customers from China selling Toys

有时,它们被定义为“或”:

UserXYZ should have access to all customers from Europe and to all food products

由于不同客户的访问权限不同,因此必须为每个用户创建一个或多个角色(如果权限基于“AND”,则必须创建一个额外的角色)。

将来,我们希望通过 table 来控制数据访问,其中定义了用户有权访问的各个对象。但恐怕无法涵盖AND/OR不同维度的逻辑。

当然MS也有动态RLS的概念(https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-tutorial-row-level-security-onprem-ssas-tabular)。但由于这只是一个维度,它不能满足我们的要求。

有人曾经在数据模型中发现过类似的问题吗?是否有任何最佳实践解决方案可以更好地处理表格模型中的个人 RLS 访问权限?

此致, 伊沃

每当您有复杂的 RLS 要求时,您的模型中都有一个简单的模式可供遵循。

引入并填充形式为 (UserName,DimensionKey) 的用户权利 table,将过滤器流向目标维度(或者可能是 (GroupId, DimensionKey) )。

所以

UserXY should have access to all customers from China selling Toys

所以提前 运行 计算“所有来自中国销售玩具的客户”的查询插入 CustomerEntilement table 所有

insert into CustomerEntitlement (UserName, CustomerId)
select 'UserXY', CustomerId
from DimCustomer c
join FactSales s 
  on s.CustomerID = c.CustomerID
where s.ProductType = 'Toys'

然后您只需在 CustomerEntitlement 上放置一个 RLS 过滤器。