Dynamic Data security in OBIEE

Here is an interesting scenario that I came across recently. The client has 2 hierarchies based on cost centers, Management and P&L. The business push behind this was that lot of users had dual roles in terms of how they look at expenses.Both the hierarchies had cost center at the lowest level and the same number of levels in the hierarchy. The differences were 1) users would have access different set of cost centers in both hierarchies (not necessarily mutually exclusive) 2) roll ups for the cost centers would be different in both hierarchies. The business had a couple of requirements around this.
1) The users should be able to pick the hierarchy that they would like to view the report by.
2) When the user flips between the hierarchies the security applied should change accordingly, ie if they are viewing the report by the P&L hierarchy then the P&L security should be applied and if they pick management then Management hierarchy security should be applied.
Here is a very simplified version of how we implemented the solution.
The security profile table
HierarchyUser_idCost_center
P&LUSER11
P&LUSER12
P&LUSER13
P&LUSER14
MGMTUSER13
MGMTUSER14
MGMTUSER15
MGMTUSER16
MGMTUSER17
User1 has access to cost centers 1-4 in the P&L hierarchy and 3-7 in the Management Hierarchy.
Here are the 2 hierarchy tables for this example.
HierarchyCost_centerLevel2Level1
P&L1P&L LVL2 1P&L LVL1 1
P&L2P&L LVL2 1P&L LVL1 1
P&L3P&L LVL2 1P&L LVL1 1
P&L4P&L LVL2 1P&L LVL1 1
P&L5P&L LVL2 2P&L LVL1 1
P&L6P&L LVL2 2P&L LVL1 1
P&L7P&L LVL2 2P&L LVL1 1
HierarchyCost_centerLevel2Level1
MGMT1MGMT LVL2 1MGMT LVL1 1
MGMT2MGMT LVL2 1MGMT LVL1 1
MGMT3MGMT LVL2 1MGMT LVL1 1
MGMT4MGMT LVL2 2MGMT LVL1 1
MGMT5MGMT LVL2 2MGMT LVL1 1
MGMT6MGMT LVL2 2MGMT LVL1 1
MGMT7MGMT LVL2 2MGMT LVL1 1
I have an expenses fact table where the cost center is a key.
clip_image002
Now lets see how this is modeled in the RPD.
Physical Layer Joins
I have aliased the security profile table as Sec Profile PL and Sec Profile Mgmt
clip_image004
There is a similar join between the Sec Profile Mgmt table with the Management Hierarchy table.
Here is how the BMM layer is done.
The cost center table will have 2 logical sources and each of these logical sources would have an inner join to the appropriate sec profile alias table.
clip_image006clip_image008
All the columns are mapped to both the logical sources.
Now we need to define appropriate fragmentation content for these 2 logical sources. Here is the Mgmt source
clip_image010
Add the user_id column to the logical table and map it to the appropriate logical sources.
Now all that’s left is to go to the relevant group in the RPD and add the security filter.
clip_image012
Create reports with the hierarchy as one of the columns and set filter to a presentation variable
clip_image014
Also create a prompt and set a presentation variable in the prompt.
clip_image016
Throw the 2 in a dashboard and lets see how the reports work for USER1
clip_image018clip_image020
Its very important to have the filter on the hierarchy column in every query otherwise you would end up overstating the numbers.