是否可以根据 SSAS 表格中的安全性为不同的用户提供不同的详细信息行表达式?

Is it possible to have different detail row expressions for different users based on security in SSAS tabular?

我正在尝试根据当前使用该模型的用户帐户在同一度量上实施不同的详细信息行表达式 (DRE)。例如: 我有一个基于带有患者信息的 table 的度量。允许用户 X 查看 DRE 中的所有列。允许用户 Y 查看除 patient_ID 和 patient_name.

之外的所有列

是否可以实现这样的东西?最好基于角色而不是特定的用户帐户。我在网上搜索过,似乎找不到这样的功能。

我正在使用 Visual Studio 2017 SSAS 表格,兼容级别:SQL Server 2017 / Azure Analysis Services (1400)

在角色级别,您可以在设置中指明用户可以访问哪些数据,但它适用于整行级别,而不是单个列级别。

我没有测试过,但也许你可以使用 USERNAME () 或 USERPRINCIPALNAME () 得到正确的结果;我想您可以创建一个包含用户名的附加“授权”table。

并且在计算本身的基础上引用它(USERNAME () in 'Authorized' [USERNAME], "Full access", "Limited access")

编辑: 2017 年,引入了 Object-Level-Security。

https://docs.microsoft.com/en-us/analysis-services/tabular-models/object-level-security?view=asallproducts-allversions#column-level-security

Similar to table-level security, with column-level security you can not only restrict access to column data, but also sensitive column names, helping prevent malicious users from discovering a column.

Column-level security is set in the JSON-based metadata in the Model.bim, Tabular Model Scripting Language (TMSL), or Tabular Object Model (TOM). Set the metadataPermission property of the columnPermissions class in the Roles object to none.

In this example, the metadataPermission property of the columnPermissions class for the Base Rate column in the Employees table is set to none:

"roles": [
  {
    "name": "Users",
    "description": "All allowed users to query the model",
    "modelPermission": "read",
    "tablePermissions": [
      {
        "name": "Employee",
        "columnPermissions": [
          {
            "name": "Base Rate",
            "metadataPermission": "none"
          }
        ]
      }
    ]
  }