- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2017 11:07 AM
Hi Guru's
Just wondering if its possible to restrict deleting attachments to the person who created the attachement AND all admins?
So the only ones that can delete the attachement from a RITM is the user that attached the file and all admins.
I have the admin restriction in place but just need help with the user that created the attachement.
Let me know what you think.
Thanks in advance.
Robert
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2017 12:38 PM
That is not correct/recommended. You need to either edit the delete ACL or create a business rule on sys_attachment table before delete. Business rule route is easy
When: before delete
Conditions: Table is sc_req_item //if you only want to have this rule in place for request item table
Script:
if(!gs.hasRole('admin') || !(current.sys_created_by==gs.getUser().getEmail())){
current.setAbortAction(true);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2017 11:12 AM
Edit the delete table acl on sys_attachment table. Post the code in your existing delete ACL on sys_attachment table, I can edit it for you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2017 11:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2017 11:50 AM
Hi Abhinay,
Please let me know if you think what i posted looks accurate.
Thank you,
Rob

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2017 12:38 PM
That is not correct/recommended. You need to either edit the delete ACL or create a business rule on sys_attachment table before delete. Business rule route is easy
When: before delete
Conditions: Table is sc_req_item //if you only want to have this rule in place for request item table
Script:
if(!gs.hasRole('admin') || !(current.sys_created_by==gs.getUser().getEmail())){
current.setAbortAction(true);
}