com.glide.script.RhinoEcmaError: "RP" is not defined. Warnings in logs

Cris6
Kilo Expert

I have a very simple ACL which has a role and a script.

Users are 'passing' the role part of the ACL with no issue, but getting denied write access to the field when evaluating the script part of the ACL.

In the script I have:

answer = !JSUtil.nil(RP.getParameterValue("sysparm_modal_override_acl"));

That url parameter is present and set to true on the Glide Modal window on which the field is located.

The logs show warnings for "RP" is not defined. If I do a gs.info(RP.getParameterValue("sysparm_modal_override_acl")) however that log returns true. (So this proves that the parameter is there?)

The field is allowing the user to make changes to it (i.e. it is not greyed out), but when they try to save the form the changes do not go through; also the field watcher logs show that write access is false to the same field:

find_real_file.png

Any ideas what could be causing this? Perhaps getting overwritten somewhere?

 

Edit: Also might be worth mentioning that I have logged the RP object in the ACL and the param

sysparm_modal_override_acl=true

is there too... so why is the ACL denying access??

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

RP won't work in ACL script

Can you try this

var value = gs.action.getGlideURI().getMap().get('sysparm_modal_override_acl');

if(value == 'true')
	answer = true;
else
	answer = false;

Regards
Ankur

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

Hello and thank you for your suggestion,

I have just tried your script and unfortunately it does the same thing.

 

It allows me to modify the field (it is not greyed out), but when I try to save the form the change does not save.

Hi,

Please enable debug security rules and check

Regards
Ankur

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

I have enabled this, it shows that script is returning answer is false