how to find non admin user in service now

Nag9
Tera Expert

How to find non admin user in servicenow, he must have permissions to raise Ritm

1 ACCEPTED SOLUTION

Can you add the log statement  in the script include after this line and tell me the log output.

     var thisUser = gs.getUser().getUserByID(userID);

gs.log("Group name is "+groupName+"----"+userID);

 

View solution in original post

93 REPLIES 93

Hello Nag,

Kindly call the script include and check the output. If you ar facing any issue, then let us know and we can assist you.

 

 

yes Asif its already called in client scrip. But while im trying to impersonate an non admin and raised a ritm and changed the task to closed complete, Still the non admin user are able to edit the variable tab on ritm form.

 

It must be read only mode

Okay.

So can you check which of your 2 conditions is returning false?

Add debugging lines in your onload clinet script after the below line.

var answer = response.responseXML.documentElement.getAttribute("answer");

alert(answer);

alert(g_user.hasRole('admin'));

This shoudl help you to debug easily.

Yes tried with my id(admin) and it shows the message as null.

Is that codes are correct?

 

In client script it shows an warning at below line

See the attachement

 

 

 

are you saying you are getting null for both alerts?

If you are getting null as admin, then there is an issue in your script include or something else. 

can you try g_form.addInfoMessage(answer); instead of alert.

g_form.addInfoMessage(g_user.hasRole('admin'));

Regarding screenshot, thats a warning. we can fix that later.