gs.getUserID() acl for read

brendanwilson84
Kilo Guru

Hi Guys

I am having some trouble with ACL. I have two list fields. A watch list and custom list field.

My acl are like this. The only two not working is the list type fields using javascript:gs.getUserID()

find_real_file.png

Can anyone help?

7 REPLIES 7

Subhajit1
Giga Guru

Hi Brendan,


You can use the script portion of the ACL to check on the Watch list and the Trainee List:-


var list = current.watch_list.toString();


var array = list.split(",");


for (var i=0; i < array.length; i++)


{


if(gs.getUserID() == array[i]));


{


return true;


}


return false;


}


And similarly for trainee list.


brendanwilson84
Kilo Guru

thanks subhajit



I tried that and was getting errors on code.



I have also tried the following but to no avail. My scripting is very limited, apologies.



var list1 = current.watch_list.toString();


var list2 = current.x_pfgb3_vendormgmt_training_request.trainee_list;


list1.push(list2);


var arr = list1.split(",");


for (var i=0; i < array.length; i++) {


  if(gs.getUserID() == array[i]) {


  answer = true;


  }


}


answer = false;


Hi Brendan,


Can you please share what kind of errors you are seeing in your code, screenshots would be great.


Also, if you are using scripts, you will need to have the whole condition matching to be done through Scripts as i see all the conditions are in the OR clause.


seems when I use return




find_real_file.png