Global system script includes not available from scopes

john_roberts
Mega Guru

There are many system provided script includes that are not accessible from custom scopes. Even though they are in the global scope they are blocked because the "accessible from" value is set to "this scope only". This is going to create a huge issue and drive everyone to make a lot of changes to system scripts.

First ones I came across were commonly used, JSUtil and TableUtils.

Changing the "accessible from" resolves the issue. Platform wide system scripts should be set to be available in all scopes or just not have the setting apply if scope is global.

"Illegal access to private script include TableUtils in scope rhino.global being called from scope x_...."

David Gatley

24 REPLIES 24

xMTinkerer
Giga Expert

Yes, i ran into this as well. Oh, add "JSONParser" to the list.


*edit: added JSONParser*


And XMLDocument:



Evaluator: java.lang.SecurityException: Illegal access to private script include XMLDocument in scope rhino.global being called from scope


  Caused by error in script at line 35



  32: gs.info("Response: " + responseBody);


  33: gs.info("HTTP Status: " + status);


  34:


==> 35: var xmlResp = new global.XMLDocument( soapResponse );


  36: var status = xmlResp.getElementValueByTagName(statusNode);


  37: var faultstring = xmlResp.getElementValueByTagName("faultstring");


  38:



Evaluator: java.lang.SecurityException: Illegal access to private script include XMLDocument in scope rhino.global being called from scope x_scp_scope


  Caused by error in script at line -1


Travis DePuy have you checked out the Fuji XMLDocument2 API?


http://wiki.servicenow.com/index.php?title=Scoped_XMLDocument2_API_Reference



JSONParser is working for me and looks like it's set for all scopes. Might have changed in a recent build so you should try that again.


Thanks John!