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

Voona Rohila
Mega Patron
Mega Patron

Hi Sweety

Did you tried anything so far?

1. in your script part use below statememt

answer= gs.getUser().isMemberOf('group name/sysid');

2. in Requires Roles section , specify the role.

https://docs.servicenow.com/bundle/sandiego-platform-administration/page/administer/contextual-secur...


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

I'll try this .

Thank you for your response

Sweety5
Tera Contributor

can we use system property to store sysid of group?

 

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