Skip to main content

HR Confidential Object  Requirement    Employee object contains:    Salary  Medical Records  PAN  Bank Details    Managers should only see Name and Department.  

3 answers
  1. Sep 7, 5:39 PM

     Hi @Rohit .

     

    Yes, this can be achieved, but not using FLS alone.  

     

    FLS is applied at the user/profile/permission-set level, so it cannot dynamically show a field based on whether the Employee record belongs to the logged-in Manager or to a subordinate.  

     

    For example, if a Manager has FLS access to Salary, that field access applies to Employee records the Manager can access. FLS doesn't provide a rule like: 

    My own record → show Salary 

     Subordinate's record → hide Salary 

    The Role Hierarchy controls record-level access, but it doesn't provide field-level restrictions based on record ownership.  

     

    For highly sensitive information such as Salary, PAN, and Bank Details, a better approach would be to keep the confidential information in a separate custom object and control access to that object/records using OWD, sharing, roles, and permission sets.  

     

    If the requirement is only to hide fields from the Lightning UI, Dynamic Forms or an LWC with conditional visibility can be considered, but UI hiding should not be treated as a security mechanism. 

    So the key distinction is: 

    FLS → Which fields can the user access? 

     OWD/Sharing/Role Hierarchy → Which records can the user access?  

     

    Hope this helps! 👍 

0/9000