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

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi Evan,

did you try to create a View Rule here?

find_real_file.png

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

Thank you very much

Cheers
Alberto

Hi Alberto,

 

Yes I have created  a view role as below.

find_real_file.png

Regards,

Evan

Try this code:

(function overrideView(view, is_list) {

  answer = null;   // set the new view to answer

  var isAdmin = gs.hasRole('admin');

  if (isAdmin) { answer = "default"; }

})(view, is_list);

Hi

Still the ITIL  user is able to change the view to default.

 

find_real_file.png

Regards,

Evan