Enforce View based on role

Patrick Slatter
Tera Guru

Morning!

 I am looking to enfoce a view based on a role. 

Example: 

IF user has Role A, enforce View A 

All other users enforce View B

 

View A = Finance Tranformaiton 

View B = Default 

Role A = Finance 

 

I am trying to accomplish this via a scripted view rule, and am not having any success. 

 

Looking to have the group of users with the role be enforced to the finance view. ALl other users would be sent to the default view, or the last view that they selected. 

 

Any asisstance that you can provide with this scripted view rule would be greatly appriciated!

1 ACCEPTED SOLUTION

Patrick Slatter
Tera Guru

I was able to self solve for anyone that runs into a similar issue 

(function overrideView(view, is_list) {
answer = view;

if (gs.hasRole("finance_transformation"))
answer = "Finance_Transformation";


})(view, is_list);

View solution in original post

2 REPLIES 2

Patrick Slatter
Tera Guru

I was able to self solve for anyone that runs into a similar issue 

(function overrideView(view, is_list) {
answer = view;

if (gs.hasRole("finance_transformation"))
answer = "Finance_Transformation";


})(view, is_list);

Hi Patrick 

 

May i know where do i write above script

 

regards

Harshal