範例 5—使用 Exists 函數來指定允許的集合

在此範例中,資料庫角色具有下表所顯示的維度安全性設定。

Attribute

IsAllowed

AllowedSet

DeniedSet

ApplyDenied

VisualTotals

State

True

 

 

True

True

City

True

{San Jose, San Francisco}

 

True

True

Gender

False

 

 

True

False

這些維度安全性設定的結果如下:

  • 對 City 屬性指定的允許集合,會限制 City 屬性之新加入成員的可見性。

  • 只看得到 State 屬性的 California 成員。(City 屬性的允許集合只包含 San Jose 和 San Francisco—加州的城市。這表示允許集合不只限制 City 屬性,還將 State 屬性的可見性限制為只有加州)。

  • Gender 屬性看不見,因為這個屬性的 IsAllowed 屬性設定為 False。

  • State 和 All Level 屬性的彙總,只會包含資料庫角色可檢視的屬性成員 (在此案例中,即 San Jose 和 San Francisco 的總計),因為 City 和 State 屬性的 VisualTotals 屬性設定為 True。

檢閱結果集

根據角色的這些維度安全性設定 (以及根據所有資料格的 Cube 存取權限),查詢所有成員時,會從 Cube 傳回下列結果集。

All Level

State

City

Gender

Sales Amount

All Offices

 

 

 

8600

 

California

 

 

8600

 

 

San Jose

 

4200

 

 

San Francisco

 

4400