ACL not working properly

amaneet
Kilo Contributor

Hi Folks,

I have one custom table/application and have modified one ACL out of the ones which get generated automatically.

My intention is to limit the visibility of records to only those where there are assigned.

So i have modified the read ACL to include one more role(ITIL)

and wrote an advanced script

answer= current.assigned_to==gs.getuserid();

everything works fine except the ITIL users are not able to create new records. Only submit button appears on form (no fields)

If i remove the advanced script from read ACL, they are able to create.

Am i missing something, please guide?

15 REPLIES 15

randrews
Tera Guru

ok so you created a read ACL that means they can only read a record if they are assigned the record.. and new records aren't assigned... so no one will ever be able to read it!!



remove the itil role as it really isn't needed...



add a NEW read acl and in the script check for itil role and isNewRecord()



this will let itil users see the new record.


lSurya 24
Giga Guru

Hello Amaneet,



You can create a new ACL on that table as create ACL and give role which there for itil users.


I believe they have create access.. or they wouldn't see the form with a submit record.. what they don't have is read access to the fields... thuys they ONLY see the submit butonn 😎 although i could be mistaken


amaneet
Kilo Contributor

Here is my modifed script :



answer=false;


if (current.assigned_to==gs.getUserID() ||   isNewRecord())


{


answer=true;


}




Now its showing all the records, i wanted only those records where the person is in assigned to field