範例 4—限制成員及其下階的存取權
在此範例中,資料庫角色對 Europe 成員的資料格及它在 Geography 維度中的下階 (France、Germany 及其 City 層級成員) 具有存取權,但該角色對該維度內之其他任何成員的資料格沒有存取權。
下列運算式是設定這些權限的多維度運算式 (MDX) 運算式:
Ancestor(Geography.CurrentMember,[Continent]) IS Europe
檢閱結果集
根據此資料庫角色的這些資料格資料權限,針對所有資料格的查詢,會傳回下表中顯示的結果集。
Continent |
Region |
Cost |
Cost |
Revenue |
Revenue |
Tax |
Tax |
---|---|---|---|---|---|---|---|
1997 |
1998 |
1997 |
1998 |
1997 |
1998 |
||
Asia |
. |
#N/A |
#N/A |
#N/A |
#N/A |
#N/A |
#N/A |
. |
Japan |
#N/A |
#N/A |
#N/A |
#N/A |
#N/A |
#N/A |
. |
Korea |
#N/A |
#N/A |
#N/A |
#N/A |
#N/A |
#N/A |
Europe |
. |
1309 |
1514 |
1675 |
1835 |
304 |
348 |
. |
France |
864 |
931 |
1002 |
1122 |
205 |
228 |
. |
Germany |
445 |
583 |
673 |
713 |
99 |
120 |
N. America |
. |
#N/A |
#N/A |
#N/A |
#N/A |
#N/A |
#N/A |
. |
Canada |
#N/A |
#N/A |
#N/A |
#N/A |
#N/A |
#N/A |
. |
USA |
#N/A |
#N/A |
#N/A |
#N/A |
#N/A |
#N/A |
![]() |
---|
如果 Microsoft Windows 使用者或群組屬於多個資料庫角色,針對所有資料格的查詢會先產生一個資料集,此資料集是根據使用者或群組所屬的每個資料庫角色產生。接著,Microsoft SQL Server Analysis Services 會將這些資料集結合成一個資料集,然後將該結合資料集傳回給使用者或群組。 |