How can a person with a specific role access the View? (View Rule not working)

tk37
Tera Contributor

I would like to allow a person holding a specific role to access the following View.

(I want to allow role holders to access other people's ess views.)
・Table : sys_user
・View : ess
・Role : u_itsm_counter

 

I created the following View Rule Script, but it did not work.
I would appreciate anyone's help.

 

・Script

(function overrideView(view, is_list) {
answer = view;
if (gs.hasRole('u_itsm_counter')) {
answer = "ess";
}
})(view, is_list);

1 ACCEPTED SOLUTION

@tk37 

Finally i found the reason.

If a user selected a view manually. 

This selection will be the first priority.

 

Set the test user's view to "default view" and test it !

 

Please mark my answer as correct and helpful based on Impact.

View solution in original post

15 REPLIES 15

tk37
Tera Contributor

Thank you for your response.

Indeed, I thought there was a possibility that you had pointed this out, so I created a test user and verified it.
I tried granting only the target role to the test user, but unfortunately it did not work.