Hide Attachments on HR LE Case both in native view and portal view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2023 02:43 PM
HI - I cannot hide attachments on the HR LE Case to 'opened_for' if he is the 'subject_person' manager in the portal view as well in the native view. I tried to create an ACL, but several other ACLs allow access to opened_for. Query Business Rule would not work.
Data Filtration does not have a sys_attachment table listed. It is not an excluded list. What would be the best approach to achieve my use case? Can someone please advise?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2023 08:39 PM
you will have to tweak the sys_attachment.READ ACL to handle this.
In native you can hide it using g_form.disableAttachments() but that may or may not work on portal, that needs to be checked
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2023 08:46 AM
Thanks for your response Ankur,I tweaked the OOTB READ ACL below line no: 90 , but did not work, There are like 40 read ACLs on attachments. It is hard to tell which ACL is giving access.
"<https://your-instance.service-now.com>/now/nav/ui/classic/params/target/sys_security_acl.do%3Fsys_id%3D0bcf23740a6a38d400c7e02590038464
line no : 90
Created a new READ ACL:
answer = getHRAttachmentReadAnswer();
function getHRAttachmentReadAnswer() {
gs.log('Veera 01 HR Case ACL read');
var tableName = current.table_name;
var parentRecord = new GlideRecord(tableName);
gs.log('Veera 02 sysid ' + current.table_sys_id + 'table name' + tableName);
// parentRecord.setWorkflow(false);
if (parentRecord.get(current.table_sys_id)) {
if (parentRecord.sys_class_name == 'sn_hr_le_case' || parentRecord.sys_class_name == 'sn_hr_core_case') {
gs.log('Veera 03 isCreatedBy ' + parentRecord.opened_for.getDisplayValue() + '==' + parentRecord.subject_person.u_manager_name);
if ( parentRecord.opened_for == gs.getUserID() && parentRecord.opened_for.getDisplayValue() == parentRecord.subject_person.u_manager_name)
return false;
} else {
return true;
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2023 11:57 AM
Also tried Query BR :