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

Yes asif i checked with a non admin user, if raised a ticket still he can able to edit the varaibles, but his existing ritm forms at varaible section shows readonly mode.

Yes asif i checked with a non admin user, if raised a ticket still he can able to edit the varaibles, but his existing ritm forms at varaible section shows readonly mode.

So is it entering the if condition of your code or not?

What is the output of the client script?

find_real_file.png

This is the output im-getting in client script.

If a non admin user raised a ticket, if i open again the same ticket it shows in read only mode variables tab

Hello NAg,

As per the script output, the 2nd line isreturningg true, which means the user with whom you are checking is admin.

g_form.addInfoMessage("Entered into the function" +answer);
g_form.addInfoMessage(g_user.hasRole('admin'));

Kindly recheck again. It should return false for non-admin users.