memberSecurity examples

This example code demonstrates the use of the tags and their nested relationship.

<bloxlogic:memberSecurity id="memberSecurity" 
   DataBloxRef="DataBlox" 
   dimensionName="Market">
   <bloxlogic:memberSecurityFilter 
      dimensionName="Measures" 
      memberName="Profit" />
   <bloxlogic:memberSecurityFilter 
      dimensionName="Measures" 
      memberName="Inventory" />
</bloxlogic:memberSecurity>
Assuming we want to provide a report on Profit and Inventory by Market, and we want:
To do so, we need to:

The complete code is as follows:

<%@ page import="com.alphablox.blox.logic.MemberSecurityFilter"%>
<%@ taglib uri="bloxtld" prefix="blox"%>
<%@ taglib uri="bloxformtld" prefix="bloxform"%>
<%@ taglib uri="bloxlogictld" prefix="bloxlogic"%>
<HTML>
<head>
   <blox:header />
</head>
<blox:data id="DataBlox" query="!" 
   dataSourceName="essbaseFilter"/>
<bloxlogic:memberSecurity id="memberSecurity" 
   DataBloxRef="DataBlox" 
   dimensionName="Market">
   <bloxlogic:memberSecurityFilter 
      dimensionName="Measures" 
      memberName="Profit" />
   <bloxlogic:memberSecurityFilter 
      dimensionName="Measures" 
      memberName="Inventory" />
</bloxlogic:memberSecurity>
<bloxform:select id="members"
   visible="false"
   multipleSelect="true" 
   size="5" >
   <%
      members.setItems(memberSecurity.getDisplayMemberNames()); 
   
</bloxform:select> 
<body>
   <blox:display bloxRef="members" />
</body>
</HTML>

If the database administrator has limited access for the logged in user as follows:

Figure 1. Profit and inventory measure dimension
The Image shows a table with two data columns, Profit and Inventory from the Measures dimension. On the row are all members from the Market dimension. The table has "#No Access" displayed in the data cells, except for New York, Massachusetts, Florida, Connecticut, New Hampshire, East, and West. That means the logged in user has no access to data for other markets, as defined by the database administrator.
The following members will be returned as a result: