Gliderecord in scripts don't obey ACLs?

chris_f
Kilo Expert

Hey All,

It seems GlideRecord when used in scripts doesn't respect ACLs? So a script can grab some information, that the user its running as doesnt have access to.

is this expected?
Thanks,

Chris

2 REPLIES 2

Atul Kumar2
Giga Guru

Hi Chris,



No, The first time when code/scripts runs it checks that is there any acl defined for that table ? if yes then it checks further that whether user is having a access to the row/column of that table. if user passes the qualification given in the acls it executes else it returns false.



Hope this helps.



Regards,


Atul Kumar


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Chris,



You should use GlideRecordSecure.


GlideRecordSecure is a class inherited from GlideRecord that performs the same functions as GlideRecord, and also enforces ACLs. Like GlideRecord, GlideRecordSecure is an object that contains zero or more records from one table. Another way to say this is that GlideRecordSecure is an ordered list that is used for database operations instead of writing SQL queries. GlideRecordSecure:


  • supports reference elements
  • is used for securing script includes

More info here.


http://wiki.servicenow.com/index.php?title=GlideRecordSecure#gsc.tab=0