- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2020 12:51 AM
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.
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.
Please help us to fix this.
Regards,
Evan
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2020 03:31 AM
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);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2020 01:43 AM
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'))
- You should remove the view_changer role if you do not want the user to be able to change view from ITIL users:
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2020 01:55 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2020 02:07 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2020 03:31 AM
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);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2020 05:30 AM
Hi Alberto,
That's great. Yipiee. It worked finally.
Thank you so much.
Evan