Add data level security using CSVIdentityMap macro
A report shows the employee names by region and country. We need to implement data security in this report such that a user can see the records only for the country he belongs to. There are already User Groups defined on the Cognos server (in the directory) and users are made members of appropriate groups.
For this sample, I have added my user account to a user group called 'Spain'.
Getting ready
Open a new list report with GO Data Warehouse (Query) as the package.
How to do it...
Drag the appropriate columns (Region, Country, and Employee name) on to the report from Employee by Region query subject.
Go to Query Explorer and drag a new detail filter.
Define the filter as:
[Country] in (#CSVIdentityNameList(',')#)
Run the report to test it. You will notice that a user can see only the rows of the country/countries of which he is a member.
How it works...
Here we are using a macro function called CSVIdentityNameList
. This function returns a list of...