Dear all,
Im working in a project, and im strugling with a task where i need to dynamically set data filter of a report.
Here is an example of my reporting table:
Professor | university | City |
aa | xxx | London |
bb | yyy | Paris |
cc | xxx | London |
this data filter will be based on user's connection.
for example : user works in university xxx and login in to my report , he should have access only to data lines related to his university,
Im thinking using Row level security but I need to figure out how, could you plz help me?
Thank you.
Betty
Hi Betty,
As an administrator, you can set row-level security based on Identity Groups. If you can group all users into custom groups corresponding to their university, you may be able to make this work. For example, if a user is at 'xxx' university, then they need to be added to a custom group named 'xxx'.
Under the data tab in Environment Manager, you then can right-click on the data table you wish to secure and select 'Edit Authorization.'
Then, add all of the university role groups 'xxx','yyy','zzz'. For each university, navigate to the 'Select' column and click the icon. Change the direct setting value to 'Row-level grant' where you can then put in your dynamic expression. For 'xxx' group you would put in the following expression to check whether the value of the university variable in your table corresponds to that identity group.
university in ('SUB::SAS.IdentityGroups')
I also recommend viewing this communities post: https://communities.sas.com/t5/SAS-Communities-Library/Examples-of-row-level-security-in-SAS-Viya/ta...
Hope this helps!
Jaime
Hi Betty,
As an administrator, you can set row-level security based on Identity Groups. If you can group all users into custom groups corresponding to their university, you may be able to make this work. For example, if a user is at 'xxx' university, then they need to be added to a custom group named 'xxx'.
Under the data tab in Environment Manager, you then can right-click on the data table you wish to secure and select 'Edit Authorization.'
Then, add all of the university role groups 'xxx','yyy','zzz'. For each university, navigate to the 'Select' column and click the icon. Change the direct setting value to 'Row-level grant' where you can then put in your dynamic expression. For 'xxx' group you would put in the following expression to check whether the value of the university variable in your table corresponds to that identity group.
university in ('SUB::SAS.IdentityGroups')
I also recommend viewing this communities post: https://communities.sas.com/t5/SAS-Communities-Library/Examples-of-row-level-security-in-SAS-Viya/ta...
Hope this helps!
Jaime
Hi jeseit,
Thank you very much for your reply.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.