Ismemberof is not working in scoped app

knopbrent
Tera Contributor

Hi Community

 

A field should be editable to the members of the Assignment group(assignment group backend value = network_security_group) . I wrote the below mentioned code on a Field level Write ACL but it is not working. Can you please take a look and let me  know where am I going wrong ?

 

The first 2 conditions are working but the 3rd condition for "ismemberof" is not working. 

Quick question - "ismemberof" doesnot work in scoped app ??

 

if (gs.hasRole('x_cld_fsg.FSG_CLD_SECURITY') || current.network_iga_contact == gs.getUserID() || gs.getUser().isMemberOf(current.network_security_group.getDisplayName().toString())) {

    answer = true;
} else {
    answer = false;
}

 

Thanks in advance

10 REPLIES 10

Ankur Bawiskar
Tera Patron
Tera Patron

@knopbrent 

try this

I assume network_security_group field holds group name or group sysId

if (gs.hasRole('x_cld_fsg.FSG_CLD_SECURITY') || current.network_iga_contact == gs.getUserID() || gs.getUser().isMemberOf(current.network_security_group)) {
    answer = true;
} else {
    answer = false;
}

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 

 

Network Security Group (network_security_group) holds the group name. Whatever the group that is assigned on the "Network Security Group" field, members of that field should have "Write" Access.

 

I have tried with the code that you have shared, it didn't worked.

 

Is there any other way that we can implement this ?

@knopbrent 

that field holds only 1 group name right?

ACL script looks fine.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar 

 

Its not a multiselect field, only one group can be assigned at a time

Hi @Ankur Bawiskar 

 

Is there any cross scope privilege that I need to enable or any config change that is missing ?