Grant a script permission to access a field which is unavailable for the User

Karl Dietrich
Kilo Sage

Hi all,

I need a field value from a field which is not available to the normal user because of an ACL. Is there a way to grant a script some kind of temporary permission to read this specific field or to bypass the ACL momentarily?

My first thought was to create an elevated role which is enabled/disabled via a script, but I cannot figure out how to hide that role under "Elevate Roles". And yes I could go with that and deactivate is every time the user tires to manually enable the elevated role, but I think the user should not be bothered with a confusing option which he cannot use. 

Thanks in advance

Karl

1 ACCEPTED SOLUTION

Willem
Giga Sage
Giga Sage

You can secure the field with ACL's for a regular (non-elevated) role. And when you need the value you can use for example an on Display business rule that loads the value using a GlideRecord Query. That way that field value is available for usage in Client scripts.

View solution in original post

4 REPLIES 4

Michael Jones -
Giga Sage

Is this a client script or a server side script? Typically server side you should be able to access any field on any record. If this is client side, usually the answer is to create a GlideAjax script include to retrieve the value you need and then call it client side, let the script run server side and return the value. Can you share the details of exactly what you're trying to accomplish?

I hope this helps!

If this was helpful, or correct, please be kind and mark the answer appropriately.

Michael Jones - Proud member of the GlideFast Consulting Team

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

I need to evaluate the content in the otherwise unaccessable field. The evaluation is in nested in Client Scripts and Catalog Client Scripts. 

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can use GlideRecord query on that table's record and can access the field value.

ACLs won't evaluate when you use GlideRecord

Regards
Ankur

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

Willem
Giga Sage
Giga Sage

You can secure the field with ACL's for a regular (non-elevated) role. And when you need the value you can use for example an on Display business rule that loads the value using a GlideRecord Query. That way that field value is available for usage in Client scripts.