ACLs should not have GlideRecord/GlideAggregate in script

Renu9
Tera Contributor

ACLs (Security rules) should not have GlideRecord/GlideAggregate in script

We have an ACL written on sys_attachment table and the script is Checking if current user is a member of any human resources group. Gliderecord to 'sys_user_grmember' is used.

Please suggest any alternative other than Gliderecord/GlideAggregate for checking.

 

12 REPLIES 12

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Renu,

Yes ServiceNow recommends to avoid using GlideRecord and GlideAggregate in ACL due to performance issue.

But since you want to check for the group membership of logged in user no need to query

use this

answer = gs.getUser().isMemberOf('Group SysID1') || gs.getUser().isMemberOf('Group SysID2');

Regards
Ankur

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

@Renu 

Hope you are doing good.

Did my reply answer your question?

If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.

Thanks!
Ankur

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

@Renu 

Hope you are doing good.

Did my reply answer your question?

If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.

Thanks!
Ankur

 

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

@Renu 

Hope you are doing good.

Did my reply answer your question?

If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.

Thanks!
Ankur

 

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