- 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 01:50 PM
Hi Abhinay,
Thanks again for your help with this, why is my approach to this problem not correct or recommended.
It seems to yield the correct results.
Thanks again.
Robert

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2017 08:12 AM
By inactivating all the ACL's, you are taking all the OOB logic out of the equation. Rather you can create a business rule I have provode or edit those OOB acls to check for the table name is request item and write your logic in that if condition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2017 12:50 PM
I did activate an ACL and added the following code...i didn't add any code for the admin but i wonder if the 'admin overrides' property allowed admins to delete.
I also added this condition to a UI Action, presumably to allow the delete function to appear in the dropdown?
Thank you again for your help with this!
Rob