-
Bug
-
Resolution: Cannot Reproduce
-
Minor
-
None
org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method groovy.text.TemplateEngine createTemplate java.lang.String
That method is overloaded. The version that accepts a File argument works (after approval), but the version that accepts a String argument does not.
To reproduce, put the following in a new pipeline project:
def engine = new groovy.text.GStringTemplateEngine(); engine.createTemplate(new File('/etc/hostname')); // This works, after script approval engine.createTemplate(''); // This fails
If the exact same code is put in the Jenkins script console, it runs fine.