The CSVIdentityName macro function

If you want row-level security based on UserClass values stored in your data source, implement a parameter map that maps the values in the data source to the corresponding roles and groups based on the user you are logged on as.

You do this by using a parameter map as an argument with the CSVIdentityName macro function. This macro function retrieves account, group, and role information for the current user. It returns a string of comma-separated values from the parameter map in single quotation marks, such as 'clerks', 'technicians', or 'typists'.

The CSVIdentityName macro function is used as a key in the specified map. You can use the list that is returned to build partial In clauses or to filter data based on the identity name of the current user.

For example, you have user classes whose names do not correspond to the Roles_Groups parameter map:

Key (role or group)

Value (user classes)

Everyone

Group1

Authors

Group2

System Administrators

Group3

Query Users

Group2

NTLM

Group2

You have this query subject:

(Security_column, value 1, value 2, value 3)

When you add a filter to the query subject, the filter uses a macro to look up a list of values, for example:

Security_column in (#CSVIdentityName(%Roles_Groups)#)

For users in the Everyone, Authors, and System Administrators roles, testing shows this as:

Security_column in ('Group1','Group2','Group3')