Hide HR case from specific users

GhitaB
Tera Contributor

Hi everyone,

I’m trying to restrict visibility of HR Lifecycle cases (sn_hr_le_case) for a specific population so that i'll be hidden from the portal as well, but I’m seeing unexpected behavior.

i created one ACL 

GhitaB_0-1769419704575.png

GhitaB_1-1769419707720.png

but when impersonating the user and type sn_hr_le_case.LIST he still can see the cases

6 REPLIES 6

Chaitanya ILCR
Mega Patron

Hi @GhitaB ,

Change the Decision type of the ACL to "Deny Unless "

ChaitanyaILCR_0-1769420875850.png

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

i did it but he still can see them

GhitaB_1-1769421251914.png

 

Hi @GhitaB ,

I think I found the issue

 

you have not specified who should not see the data, you have just specified what data should not bee seen.

 

the who part is missing.

 

you can you check the advanced checkbox and write script and evaluate the who part 

 

since you have not shared the details I can't provide any script.

 

if you still need assistance please explain the business requirement in detail.

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

(function () {

    // Always allow admins / HR admins
    if (gs.hasRole('admin') || gs.hasRole('sn_hr_admin')) {
        return true;
    }

    // Safety checks
    if (!current || !current.subject_person) {
        return true;
    }

    // Get subject person's HR profile
    var hrProfile = current.subject_person.hr_profile;
    if (!hrProfile) {
        return true;
    }

    var employmentType = hrProfile.employment_type + '';
    var country = hrProfile.u_legal_entity && hrProfile.u_legal_entity.u_country + '';
    var hrService = current.hr_service + '';

	var OFFBOARDING_SERVICE_SYSID = '58d30358c3f4d2505c227e53e40131ed';

    // BLOCK condition:
    // Spain + Subcontractor + Offboarding
    if (
        employmentType === 'subcontractor' &&
        country === 'Spain' &&
        hrService ===  OFFBOARDING_SERVICE_SYSID
    ) {
        return false;
    }

    // Allow everything else
    return true;

})();

 

i've added that script but still same issue

 

what i want to do is to hide offboarding cases from the subject person when his employment type is subcontrctor and he is from spain.

 

because it was asked to hide them from the portal so that he will not have access to em