Restricting/Locking/Password Protecting Attachments on HR Case Form

Rob Sestito
Mega Sage

Hello SN Comm,

I want to see if anyone knows a good way to protect attachments that are attached to an HR Case form? Can it be locked to only the Assigned To (and maybe also certain users with a special role, etc.)?

Maybe even having to enter in a password when trying to view the attachment from the Case?? I feel like that idea is pretty far out there, but hey - ya never know what the system can to until you go through it and/ or ask!

Thank you,

-Rob

 

Cody Smith _ Cl
Tera Guru

You could create a Read ACL for sys_attachment. Using something similar to this. 

 if(current.table_name == 'hr_case'){
   if(current.sys_created_by == gs.getUserName() || gs.hasRole('The Role you are looking for')){
     return true;
    }else{
      return false;
    }
}

 

If my answer was helpful, or solved your issue, please mark it as Helpful / Correct.
Thank you,
Cody Smith
 

Hey Cody,

Thanks for replying - as I thought that would be a good way to go actually. I adjusted the code you provided as I would need (correct table and role to use). But I get the following error, and I am unable to see it. Are you able to see it?

find_real_file.png

Thanks,

-Rob

Hey - I think I got it.

find_real_file.png

Yeah, that looks right.