- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2018 06:52 AM
Hello,
We have a requirement to lock down records (REQ and RITM) to one catalog item Spot Bonus. Those can view would be those with a manager role as long the manger is not the one who getting the spot bonus. There is a variable called user receiving bonus. I am having issues restricting the manager from seeing it if they are the user in the variable. Any assistance is appreciated.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2018 02:17 PM
Use below script
if(current.request_item.variables.variablename!= gs.getUserID() )
answer=true;
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2018 06:57 AM
I think you need to make you code != gs.getUserID();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2018 09:46 AM
Hello,
I tried the gliderecord query, but does not work. Manager cannot see any of the RITM's now even the ones they allowed to see.
var currentUser = gs.getUserID();
var queryString = "active=true^cat_item=22e96da3137297004de67e776144b0dd^variables.1b824ebb133e9700fa7c73076144b072ISNOTEMPTY";
var spotuser = new GlideRecord(sc_req_item);
addEncodedQuery(queryString);
while (spotuser.next()) {
var comp = spotuser.getValue('1b824ebb133e9700fa7c73076144b072');
gs.log("Chad " + comp);
if(comp != currentUser);
answer=true;
}
//gs.log(currentUser.getDisplayName());

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2018 12:23 PM
maybe change it to var queryString = 'active=true^variables.9e6ce1a44fe3130018888fe18110c7df!=' + currentUser;
Then in your while look you only need to answer = true;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2018 12:45 PM
FYI... that sys_id is from my system so you have to update with your sys_id.