How to use Jenkinsfile to set job permission properties (AuthorizationMatrixProperty)

859 views
Skip to first unread message

Rudy Gevaert

unread,
Dec 7, 2016, 1:05:50 PM12/7/16
to Jenkins Users
Hello Jenkins users

I'm trying to use the Jenkinsfile to set the permissions of a job.  When I use the groovy Snippet Generator it gives me this

properties([<object of type hudson.security.AuthorizationMatrixProperty>, pipelineTriggers([])])

How can I do this?

I managed to set all my parameters of the job through the properties function, however it resets every time the permissons I set through the webinterface.  (Which is a real problem).  So I need to know how to set the permissions through the Jenkinsfile.

Thank you in advance,

Rudy

seva.p...@gmail.com

unread,
Nov 12, 2017, 6:28:41 AM11/12/17
to Jenkins Users
Absolutey the same. Snippet generator prints out object's "signature" instead of pipeline instruction set:
properties([<object of type hudson.security.AuthorizationMatrixProperty>, pipelineTriggers([])])



Did anybody know: how to owercome it and obtain valid instructions set with auth matrix for an account?

Or simple:

What is a syntax for or how to specify authorization matrix property inside Jenkins pipeline script???

Daniel Beck

unread,
Nov 12, 2017, 9:04:01 AM11/12/17
to jenkins...@googlegroups.com

> On 12. Nov 2017, at 11:35, seva.p...@gmail.com wrote:
>
> What is a syntax for or how to specify authorization matrix property inside Jenkins pipeline script???

Per your other question, you're still on 2.7.x -- but for this, you need matrix-auth plugin 2.0 or newer, which requires Jenkins 2.60.x or newer.

Reply all
Reply to author
Forward
0 new messages