User with sn_customerservice.customer role is unable to view the attached documnet in the backend

Samiksha2
Mega Sage

Hello,

User with sn_customerservice.customer role is unable to view the attached documnet in the case form in the backend.I have created read roles for the attachment table as well. But still user is not able to view.

Please help.
Thanks,
Sam

1 REPLY 1

HasanM
Kilo Sage

Hi @Samiksha2 

I checked this on a PDI. The out-of-the-box read ACL on sys_attachment (sys_id 0bcf23740a6a38d400c7e02590038464) calls new global.AttachmentSecurity().canRead(current), which checks whether the user can read the parent record. It only applies to snc_internal, sn_customerservice.requester and sn_esm_user. No sys_attachment read ACL covers sn_customerservice.customer, which is why the attachment doesn't show. Case read access for customers comes from CSM query rules (case ACL sys_id 242a076ab3ba1010700b4d43c6a8dc8b), so if the user can open the case, the attachment ACL is the gap.

Suggestion: don't edit the out-of-the-box ACL. Create a new one instead:

Type: record, Operation: read, Name: sys_attachment
Requires role: sn_customerservice.customer
Condition: Table name is sn_customerservice_case
Script:
answer = false;
if (current.table_name == 'sn_customerservice_case') {
var cs = new GlideRecord('sn_customerservice_case');
if (cs.get(current.table_sys_id)) {
answer = cs.canRead();
}
}

This only exposes attachments on cases the customer can already read. Test it by impersonating a customer contact and using Access Analyzer. Also bear in mind that customer users are meant to use the CSM portal rather than the backend case form.

If this helped, please mark it as the accepted solution.