Exploring, modeling, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

Apply display rule on basis of current user.

Accepted Solution Solved
Reply
Occasional Contributor Pcp
Occasional Contributor
Posts: 7
Accepted Solution

Apply display rule on basis of current user.

Hi All,

 

Is there any way to apply display rule on basis of current user id ? 

I want to only highlight (change background color of) a row having current user in a list table. Is there any way to use SASSmiley FrustratedUB::UserID

in display rule for comparison ? or can we do this by using STP ?

Any help will be appreciated.

 

Thanks for your time,

PCP.


Accepted Solutions
Solution
‎10-12-2016 03:34 AM
SAS Super FREQ
Posts: 70

Re: Apply display rule on basis of current user.

[ Edited ]

Hi PCP,

 

If you are ok with the user having to click on a button with his/her name to highlight the line containing the name, then this may work for you.

 

Here is an example of report just opened by user Christine Fletcher (note that her name is on the top, and if another user had open this same report, the other user's name would have been displayed instead):

 

Figure 1-Open Report.PNG

 

After she clicks on the top button, her name is selected according to the dsplay rule:

 

Figure 2-Click on Button.PNG

 

This is how it works:

 

I've used two source tables in this example. One source table (EMPLOYEE) contains the list of employees that I used to populate the button bar at the top. The other source table contains the data to be displayed in the list table object.

 

For the button bar, I've also assigned a character parameter that I've called LoggedUser:

 

Figure 3-Button Bar Roles Assignment.PNG

 

Because display rules depend on numeric values only, I've created a calculated column based on the column Employee Name found in the second table. I've called that new column Flag for Rule, that looks like this:

 

Figure 4-Flag for Rule.PNG

 

Then the display rule (I've chosen to highlight the entire row):

 

Figure 5-Display Rule.PNG

 

Now, to guarantee that the top button bar contains only the name of the user logged in, I had to apply row level security to the EMPLOYEE table. The conditional grant was applied to the Read permission for the SASUSERS group and looked like below. Note that for this to work the user's metadata identity name must match with the value stored in the Employee_Name column. You can use other functions in the exression if needed, such as upcase(), trim(), etc.

 

Figure 6-Permission Condition.PNG

 

If you really want to use their ID's instead of their names, then you could do so by storing their ID's as metadata External Indentities in SAS Management Console:

 

Figure 7-External Identity.PNG

 

The permission condition expression would then be something like this (Employee_ID is the column from your table):

 

SUB:Smiley FrustratedAS.ExternalIdentity = Employee_ID

 

I hope it helps.

 

Best,

Renato

View solution in original post


All Replies
Solution
‎10-12-2016 03:34 AM
SAS Super FREQ
Posts: 70

Re: Apply display rule on basis of current user.

[ Edited ]

Hi PCP,

 

If you are ok with the user having to click on a button with his/her name to highlight the line containing the name, then this may work for you.

 

Here is an example of report just opened by user Christine Fletcher (note that her name is on the top, and if another user had open this same report, the other user's name would have been displayed instead):

 

Figure 1-Open Report.PNG

 

After she clicks on the top button, her name is selected according to the dsplay rule:

 

Figure 2-Click on Button.PNG

 

This is how it works:

 

I've used two source tables in this example. One source table (EMPLOYEE) contains the list of employees that I used to populate the button bar at the top. The other source table contains the data to be displayed in the list table object.

 

For the button bar, I've also assigned a character parameter that I've called LoggedUser:

 

Figure 3-Button Bar Roles Assignment.PNG

 

Because display rules depend on numeric values only, I've created a calculated column based on the column Employee Name found in the second table. I've called that new column Flag for Rule, that looks like this:

 

Figure 4-Flag for Rule.PNG

 

Then the display rule (I've chosen to highlight the entire row):

 

Figure 5-Display Rule.PNG

 

Now, to guarantee that the top button bar contains only the name of the user logged in, I had to apply row level security to the EMPLOYEE table. The conditional grant was applied to the Read permission for the SASUSERS group and looked like below. Note that for this to work the user's metadata identity name must match with the value stored in the Employee_Name column. You can use other functions in the exression if needed, such as upcase(), trim(), etc.

 

Figure 6-Permission Condition.PNG

 

If you really want to use their ID's instead of their names, then you could do so by storing their ID's as metadata External Indentities in SAS Management Console:

 

Figure 7-External Identity.PNG

 

The permission condition expression would then be something like this (Employee_ID is the column from your table):

 

SUB:Smiley FrustratedAS.ExternalIdentity = Employee_ID

 

I hope it helps.

 

Best,

Renato

Occasional Contributor Pcp
Occasional Contributor
Posts: 7

Re: Apply display rule on basis of current user.

[ Edited ]

Hi Renato,

 

It worked for me by adding button bar.

 

Thanks alot,

PCP

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 548 views
  • 2 likes
  • 2 in conversation