Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

need to apply filter on acl

Sweety5
Tera Contributor

Hello everyone , 

                          I need to create one ACL with delete operation for table with following condition :- 

 1 . If they are member of this group "Help Desk"

  2. they have  "u_help_desk" role . 

Kindly suggest me solution for this with best practice .

Thanks in advance !!

 

1 ACCEPTED SOLUTION

Akanksha Gupta2
Mega Guru

Hi , 

Please use this code :-

var abc = gs.getProperty('property name'); 

gs.log(' value is '+ abc);

if(gs.getUser().isMemberOf(abc) || gs.hasRole('sla_admin')) {
answer = true;
}else{
answer = false;
}

Kindly mark it as helpful or correct .

Regards,

Akanksha

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@Sweety 

It's recommended not to hard-code names or sys_ids

you can create system property of type string and store group name in it

then use that

answer= gs.getUser().isMemberOf(gs.getProperty('propertyName')); // give name of property here

Regards
Ankur

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