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.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.