Did you try
org.jvnet.hudson.plugins.m2release.M2ReleaseBuildWrapper.DescriptorImpl.CREATE_RELEASE ?

/James



On 5/16/2017 7:50 PM, Logan Twedt wrote:
Hi Tina, et all,

I'm also trying to configure the Release permission using a groovy script. I do see that the permission is called CREATE_RELEASE inside an inner class in the m2Release plugin code on GitHub: https://github.com/jenkinsci/m2release-plugin/blob/2f2865cffdd7e4be2a60156f245fabc9508d870b/src/main/java/org/jvnet/hudson/plugins/m2release/M2ReleaseBuildWrapper.java - but I've also tried that Permission name and it doesn't work. Maybe I'm reading that code wrong, not sure.

Has anyone been able to get this working?

-Logan

On Thursday, April 6, 2017 at 9:59:42 AM UTC-5, Tina Danielsson wrote:

    I'm trying to create a groovy script where I set the release
    permissions fort he M2 Release Plugin. But I can't figure out how
    to do that. The build in permissons can be accessed via
    hudson.model.Item.PROPERTY, for example hudson.model.Item.CANCEL.
    But hudson.model.Item.Release just returns "No such property".

    Any ideas on how to access this property?

    |
    importhudson.security.*

    defjob =Hudson.instance.items.find{job ->job.name =="MyJob"}
    defauthorizationMatrixProperty
    =job.getProperty(AuthorizationMatrixProperty.class)

    authorizationMatrixProperty?.add(hudson.model.Item.CANCEL,"TESTUSER")
    authorizationMatrixProperty?.add(hudson.model.Item.RELEASE,"TESTUSER")
    |


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com <mailto:jenkinsci-users+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/4f03307f-0a28-4af2-8b5a-9af572d80300%40googlegroups.com <https://groups.google.com/d/msgid/jenkinsci-users/4f03307f-0a28-4af2-8b5a-9af572d80300%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Jenkins 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/10f8985b-6acb-1cec-a85b-1ce48ab591b5%40teilo.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to