Limit Parameter Selectors based on Security

micajblock
edited February 11, 2022 in Analytics #1
I recently came across a requirement where a customer wanted to limit the list appearing in a selector is limited based on security, so that values each user see is limited to what they are allowed to see. For example a sales rep would see a list of their customers only.<br />
<br />
Thanks to Rob Murphy and Hawaiian Geff and Kalesh [color=rgb(31,73,125)]Mahendrakar [/color][color=rgb(31,73,125)]for the ideas. Attached is a project (built in A11 SP4, but should work in iHub2 also) that shows 3 ways one can accomplish this. I thought I would share.[/color]<br />
<br />
Parameter.rptdesign – This uses a parameter on the query for the data set (no report parameter) and then sets a default value for that parameter (in the data set UI) to reportContext.getAppContext().get("ServerUserName"). You can run this in the iServer (you will need to create user names that are the countries in Classic Models customers table). Thanks to Kalesh for the idea and Geff for reminding me.<br />
<br />
ParameterACL.rptdesign – Similar to the above report but it uses the ACL instead of the user name. It assumes the user has one role named “Country_” concatenated with the country name (for example Country_USA).<br />
<br />
SecureDO.rptdesign – This uses SecureSelector.data file which has row level security defined as: row/font][/color][color=#2a00ff][font='segoe ui']"COUNTRY"[/font][/color][color=#000000][font='segoe ui' + ",Country_" + row/font][/color][color=#2a00ff][font='segoe ui']"COUNTRY"[/font][/color][color=#000000][font='segoe ui'[color=rgb(31,73,125)]. So all you need to do is either define users or roles with either the country name or “Country_” concatenated with the country name. Thanks Rob for the idea.[/color]<br />
<br />
I hope this helps others.