Prevent user from deleting the attachment

kumaran
Giga Expert

I have a requirement to restrict user from deleting the attachment in requested item table.

If any one has implemented this requirement please share your thoughts.

Thanks in advance

9 REPLIES 9

You can simply write the condition in the script field.



if(current.field_name.indexOf('ABC') != -1)


answer = false;


else


answer = true;



Note: current will point to sys_attachment table. Have a look at the table to construct the right condition.


I will give it a try and update you


It is not working. Please help


It will work. Check for all the existing ACLs. By default there will be two 'Delete' ACLs on sys_attachment table. If you create new one there will be 3 ACLs. Be informed that if any one of them grant access to the user, user will get the access.



Try this,


Inactivate the default two ACLs and then your ACL will take effect.



Note : Please modify the two ACLs as per your requirement as it'll have global effect. And I encourage you to go through the code of these ACLs once for better understanding.


How come you made the answer false inside the script?