Scripts not permitted to use staticMethod in Extensible Choice System Groovy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Scripts not permitted to use staticMethod in Extensible Choice System Groovy

Victoria Kozel
Hello,

I am writing a simple groovy script to display role-based choices in the Extensible Choice. I get 

org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod jenkins.model.Jenkins getInstance

when calling 

def authStrategy = Jenkins.instance.getAuthorizationStrategy()

I am not sure I understand the reason for this, but my question is - Is there a workaround for this error?

Thank you!!
Vicki

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/4eb0b360-114a-4230-915e-bb1ec258de44%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Scripts not permitted to use staticMethod in Extensible Choice System Groovy

Victor Martinez
Please use the right mailing list and don't cross post your questions!

- https://jenkins.io/content/mailing-lists/

In the above url you can find further details about how to ask and where exactly.

Cheers

On Friday, 21 April 2017 01:02:17 UTC+1, Victoria Kozel wrote:
Hello,

I am writing a simple groovy script to display role-based choices in the Extensible Choice. I get 

org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod jenkins.model.Jenkins getInstance

when calling 

def authStrategy = Jenkins.instance.getAuthorizationStrategy()

I am not sure I understand the reason for this, but my question is - Is there a workaround for this error?

Thank you!!
Vicki

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/02131c63-3473-4fd9-bf9a-21f77f5472f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.