ACL to restrict records

Shalini Priya1
Tera Contributor

Hi ,

Can anyone help me on the below issue :

1.I have a check box on the incident form   ,

2.If the checkbox is true then Assigned To /Watch List   contains current logged in user then the user should have access to the form

or else no other user should have access to the form from List Layout ,Global search .How can i do it from an ACL .

Note :If Assigned To/Watch List user   is not current logged in user then he shouldn't have access to the record ,and shouldn't open it from List view & global search as well.

I Created Read ACL --

Name :Incident*

Operation:Read

Type:Record:

Advanced :True

Condition : If checkbox is true

Script :

answer=(function(){

if(current.getValue("assigned_to")==gs.getUserID() || current.getValue("watch_list").indexOf(gs.getUserID())!=-1){

return true;

}

return false;

})();

Still i can see the records even if i'm not the logged in user as below screen shot:

So when I impersonated as Assigned To User .There are more than 29 incidents of   which 3 incidents are Assigned to ITIL User. Thus, I expected only 3 record to be displayed , but instead there are 29. Incidents AssignedTo ITIL Users as normal, but all the other records on the table are completely blank. Here is the screenshot:

find_real_file.png

Blank Record which are not Assigned to ITIL User still i can open the record as below:

find_real_file.png

Thanks,

Shalini

5 REPLIES 5

Ujjawal Vishnoi
Mega Sage
Mega Sage

Hi Shalini,



Make couple of changes in your acl.


1. change it to incident.none.


2.. put else in the script between line 8&9.



Hope this helps.



Regards


Ujjawal