ACL not working with condition builder

jamhoe
Tera Expert

Hi All,

I am creating an ACL to restrict a user with a custom role to access and update Incident records.

I have tried to create a Read ACL rule with the following configurations:

find_real_file.png

find_real_file.png

However, if i tried to impersonate a user with a 'bu_itil' role, those 3 records does not display on the incident list.

I have also tried to script the condition but it is not evaluated when I checked it on the debug logs.

Maybe you guys can help me out on this . TIA.

1 ACCEPTED SOLUTION

Hi Amlan,



I used the code you have provided, however it did not provide me the right results.



But, I tried to tweak the code based on what you have provided and it does the trick.



find_real_file.png



find_real_file.png



Thanks for the help.



Regards,


JM


View solution in original post

21 REPLIES 21

Hi Joe,



I'm Glad it helped you.



May I consider that the issue is resolved? If so, please mark the Answer Correct and Close the thread.


Hi Amlan,



Really appreciate your help, however the result that I want is:



Using the 'bu_itil' role, when I click the 'ALL' module of incident, only these records should display:


find_real_file.png


Hi Joe,



Okay. It's clear now. You may obtain this by using the same Business rule, i.e., incident query. Please use the modified script given below:



if (!(gs.hasRole("itil") || gs.hasRole("test")) && gs.isInteractive()) {


  var u = gs.getUserID();


  var qc = current.addQuery("caller_id", u).addOrCondition("opened_by", u).addOrCondition("watch_list", "CONTAINS", u);


  gs.print("query restricted to user: " + u);


}


else if(gs.hasRole("bu_itil")){


  //Please pass the exact Field Name of 'Business Unit' and also the value of 'RRG' in the below line


  current.addQuery("field_name_of_Business_Unit", 'Value_of_RRG');


}



I hope this helps. Please mark correct/helpful based on impact


Hi Amlan,



I used the code you have provided, however it did not provide me the right results.



But, I tried to tweak the code based on what you have provided and it does the trick.



find_real_file.png



find_real_file.png



Thanks for the help.



Regards,


JM


Hi Joe,



Glad to know that you have achieved the requirement.


If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.


If you are viewing this from the community inbox you will not see the correct answer button.   If so, please reviewHow to Mark Answers Correct From Inbox View