Restrict non admin users to see user form default view

Evan2
Kilo Guru

Hi All,

I am trying to restrict the non admin users to see the users form default view. There has been reported instances when the ITIL users are able to access their profile by navigating My Profile. Initially their profile shown in self service view. 

find_real_file.png

 

But users are able to change the view to default view and thus they are able to amend many of the fields. Now we want to restrict users to see default view for users table.

find_real_file.png

find_real_file.png

 

Please help us to fix this.

Regards,

Evan

1 ACCEPTED SOLUTION

Hey Evan,

just create a View Rule with the following Script, in this way, ITIL users will continue to see the Default View, however if they click on it, they will get automatically force to the ESS view, that's the best you can do so far:

(function overrideView(view, is_list) {

	if (gs.hasRole("admin"))
{return;}

answer = "ess"; 

})(view, is_list);

find_real_file.png

View solution in original post

10 REPLIES 10

Ok, two things to do:

  • put the below condition in the View Context Menu

ListProperties.canChangeView() && gs.hasRightsTo('ui/context_menu.view/read', null) && (gs.getUser.hasRole('admin'))

find_real_file.png

  • You should remove the view_changer role if you do not want the user to be able to change view from ITIL users:

find_real_file.png

Hope this fix your problem!

If I have answered your question, please mark my response as correct and/or helpful.

Thank you very much

Cheers
Alberto

Hi Alberto,

 

I believe this is not correct approach as if i remove view_changer  role from the ITIL role bundle user will not be able to change the view on any of the forms (ex. Incident, Change, Problem etc.). We just want to restrict the users to view default view on the user forms only.

 

Regards,

Evan

I agree with you, the second point is never a good option.

Please try to apply the View Rule plus the first point (change in the "View Context Menu"), I tried in my PDI, basically ITIL user will see the Default View in the header menu, however when you click it will be always redirect to the ESS view.

Give a try and let me know if this is a good option for you.

 

Hey Evan,

just create a View Rule with the following Script, in this way, ITIL users will continue to see the Default View, however if they click on it, they will get automatically force to the ESS view, that's the best you can do so far:

(function overrideView(view, is_list) {

	if (gs.hasRole("admin"))
{return;}

answer = "ess"; 

})(view, is_list);

find_real_file.png

Hi Alberto,

 

That's great. Yipiee. It worked finally.

 

Thank you so much.

Evan