Restrict Access to Group member using ACL

MelwinA
Tera Contributor

I have requirement to restrict access to user if user is member of particular group.
When user is member of particular group, user should see case which is assigned to two groups. For that I wrote below script, but it is not working as expected.
I am using Deny Unless Read ACL for "sn_hr_core_case" table.

if (gs.getUser().isMemberOf('Talent Acquisition Coordination Representative  India') && !gs.getUser().isMemberOf('Talent Acquisition Coordination Representative Manila')) {

            if (current.assignment_group == talentAcqspecialistIndia ||  current.assignment_group == talentAcqIndia) {
                answer = true;
            } else {
                answer = false;
            }
		}else
		{
			answer = true;
		}

The issue here, logged in user is able to see case assigned to the first group in if loop (

talentAcqspecialistIndia). second group after Or condition(
talentAcqIndia) is not working.

 

6 REPLIES 6

SD_Chandan
Kilo Sage

Hi @MelwinA ,

Can you try this 
if (current.assignment_group.toString() == talentAcqspecialistIndia || current.assignment_group.toString() == talentAcqIndia )

in second if condition

If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.


Thank you
Chandan

Hi @SD_Chandan 

I have tried this already. Still the same. It is not working.